Skip to content

Commit

Permalink
merging
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjinliu committed Mar 10, 2024
2 parents 7fe27eb + 1bc0a45 commit c331e05
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers = [
dependencies = [
"typing_extensions>=4.5.0",
"numpy>=1.23.2",
"psygnal>=0.9.4",
"psygnal>=0.9.4,<0.10.0",
"cmap>=0.1.2",
]

Expand Down
4 changes: 3 additions & 1 deletion tests/test_canvas.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from pathlib import Path
import tempfile
import numpy as np
Expand Down Expand Up @@ -324,4 +325,5 @@ def test_screenshot(backend: str):
backend += ":qt"
canvas = new_canvas(backend=backend)
canvas.add_line([0, 1, 2], [0, 1, 2], name="line")
canvas._repr_png_()
if sys.platform != "win32": # NOTE: testing in GitHub Actions fails for some reason
canvas._repr_png_()
4 changes: 3 additions & 1 deletion whitecanvas/backend/vispy/_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class Axis(scene.AxisWidget):
axis: AxisVisual

def __init__(self, canvas: Canvas, dim: int, **kwargs):
kwargs.setdefault("axis_width", 2)
kwargs.setdefault("tick_width", 1)
super().__init__(**kwargs)
self.unfreeze()
self._dim = dim
Expand Down Expand Up @@ -154,7 +156,7 @@ def _plt_set_visible(self, visible: bool):
def _plt_get_size(self) -> float:
return self._text.font_size * FONT_SIZE_FACTOR

def _plt_set_size(self, size: str):
def _plt_set_size(self, size: float):
self._text.font_size = size / FONT_SIZE_FACTOR

def _plt_get_fontfamily(self) -> str:
Expand Down
1 change: 0 additions & 1 deletion whitecanvas/backend/vispy/band.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def __init__(
self._mesh.set_gl_state(
polygon_offset_fill=True,
polygon_offset=(1, 1),
cull_face=False,
)
self.freeze()

Expand Down
8 changes: 7 additions & 1 deletion whitecanvas/backend/vispy/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,13 @@ def _plt_set_aspect_ratio(self, ratio: float | None):
self._camera.aspect = ratio

def _plt_add_layer(self, layer: visuals.visuals.Visual):
layer.set_gl_state("opaque", depth_test=False)
layer.set_gl_state(
depth_test=False,
cull_face=False,
blend=True,
blend_func=("src_alpha", "one_minus_src_alpha", "one", "one"),
blend_equation="func_add",
)
layer.parent = self._viewbox.scene

def _plt_remove_layer(self, layer):
Expand Down

0 comments on commit c331e05

Please sign in to comment.