diff --git a/pyproject.toml b/pyproject.toml index dfcbdab0..29c4d8de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", ] diff --git a/tests/test_canvas.py b/tests/test_canvas.py index 3d4c3e4d..4610e795 100644 --- a/tests/test_canvas.py +++ b/tests/test_canvas.py @@ -1,3 +1,4 @@ +import sys from pathlib import Path import tempfile import numpy as np @@ -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_() diff --git a/whitecanvas/backend/vispy/_label.py b/whitecanvas/backend/vispy/_label.py index a2e36a37..8fda8675 100644 --- a/whitecanvas/backend/vispy/_label.py +++ b/whitecanvas/backend/vispy/_label.py @@ -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 @@ -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: diff --git a/whitecanvas/backend/vispy/band.py b/whitecanvas/backend/vispy/band.py index 312be318..48899581 100644 --- a/whitecanvas/backend/vispy/band.py +++ b/whitecanvas/backend/vispy/band.py @@ -33,7 +33,6 @@ def __init__( self._mesh.set_gl_state( polygon_offset_fill=True, polygon_offset=(1, 1), - cull_face=False, ) self.freeze() diff --git a/whitecanvas/backend/vispy/canvas.py b/whitecanvas/backend/vispy/canvas.py index d109c43d..0b638551 100644 --- a/whitecanvas/backend/vispy/canvas.py +++ b/whitecanvas/backend/vispy/canvas.py @@ -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):