Skip to content

Commit 247c191

Browse files
committed
bug and filter out wheel events too
1 parent 1ad7c0f commit 247c191

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fastplotlib/layouts/_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pygfx
44
from pygfx import WgpuRenderer, Texture, Renderer
5-
from pygfx.renderers.wgpu.engine.renderer import EVENT_TYPE_MAP, PointerEvent
5+
from pygfx.renderers.wgpu.engine.renderer import EVENT_TYPE_MAP, PointerEvent, WheelEvent
66

77
from wgpu.gui import WgpuCanvasBase
88

@@ -18,7 +18,7 @@ def __init__(self, target, *args, **kwargs):
1818
def convert_event(self, event: dict):
1919
event_type = event["event_type"]
2020

21-
if EVENT_TYPE_MAP[event_type] is PointerEvent:
21+
if EVENT_TYPE_MAP[event_type] in [PointerEvent, WheelEvent]:
2222
for filt in self.event_filters.values():
2323
if (
2424
filt[0, 0] < event["x"] < filt[1, 0]

fastplotlib/utils/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def make_colors(n_colors: int, cmap: str, alpha: float = 1.0) -> np.ndarray:
6363
if n_colors > max_colors:
6464
raise ValueError(
6565
f"You have requested <{n_colors}> colors but only <{max_colors}> exist for the "
66-
f"chosen cmap: <{name}>"
66+
f"chosen cmap: <{cmap}>"
6767
)
6868
return np.asarray(cm.color_stops, dtype=np.float32)[:n_colors, 1:]
6969

0 commit comments

Comments
 (0)