Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 22bf7d6 + 6d0c9a8 commit 4a8d4c7Copy full SHA for 4a8d4c7
lib/matplotlib/backends/backend_qt.py
@@ -312,8 +312,10 @@ def mouseReleaseEvent(self, event):
312
313
def wheelEvent(self, event):
314
x, y = self.mouseEventCoords(self._get_position(event))
315
- # from QWheelEvent::delta doc
316
- if event.pixelDelta().x() == 0 and event.pixelDelta().y() == 0:
+ # from QWheelEvent::pixelDelta doc: pixelDelta is sometimes not
+ # provided (`isNull()`) and is unreliable on X11 ("xcb").
317
+ if (event.pixelDelta().isNull()
318
+ or QtWidgets.QApplication.instance().platformName() == "xcb"):
319
steps = event.angleDelta().y() / 120
320
else:
321
steps = event.pixelDelta().y()
0 commit comments