Merge pull request #739 from campagnola/wheel-event-fix

Fix error in ViewBox wheelEvent when mouse has 2-axis wheel events
This commit is contained in:
Luke Campagnola 2018-07-30 11:46:43 -07:00 committed by GitHub
commit 9aaae8d5dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: