From f1b51027cc44377133d9c2a739e007c1e047948f Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Mon, 30 Jul 2018 11:36:08 -0700 Subject: [PATCH] Fix error in ViewBox wheelEvent when mouse has 2-axis wheel events --- pyqtgraph/graphicsItems/ViewBox/ViewBox.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py index b1cd3c10..0982cb37 100644 --- a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py +++ b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py @@ -1124,8 +1124,8 @@ class ViewBox(GraphicsWidget): """Return the bounding rect of the item in view coordinates""" return self.mapSceneToView(item.sceneBoundingRect()).boundingRect() - def wheelEvent(self, ev, axis=None): - if axis is not None and axis >= 0 and axis < len(mask): + def wheelEvent(self, ev, axis=None): + if axis in (0, 1): mask = [False, False] mask[axis] = self.state['mouseEnabled'][axis] else: