diff options
author | Blaine | 2020-06-12 22:00:19 +0530 |
---|---|---|
committer | Blaine | 2020-06-12 22:00:19 +0530 |
commit | 635578dbb93d635de80f5cb38efa5d6eb837ca51 (patch) | |
tree | 805b6cc807f03aea93eb301441934d2227a80e51 /src/main/python/utils | |
parent | d3bb58bc5d77b02d2102c6a59151cff6beee662f (diff) | |
download | Chemical-PFD-635578dbb93d635de80f5cb38efa5d6eb837ca51.tar.gz Chemical-PFD-635578dbb93d635de80f5cb38efa5d6eb837ca51.tar.bz2 Chemical-PFD-635578dbb93d635de80f5cb38efa5d6eb837ca51.zip |
weird keyboard shotcut fixed
Diffstat (limited to 'src/main/python/utils')
-rw-r--r-- | src/main/python/utils/graphics.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/python/utils/graphics.py b/src/main/python/utils/graphics.py index e17fa49..c799217 100644 --- a/src/main/python/utils/graphics.py +++ b/src/main/python/utils/graphics.py @@ -54,7 +54,7 @@ class customView(QGraphicsView): def wheelEvent(self, QWheelEvent): #overload wheelevent, to zoom if control is pressed, else scroll normally - if Qt.ControlModifier: #check if control is pressed + if QWheelEvent.modifiers() & Qt.ControlModifier: #check if control is pressed if QWheelEvent.source() == Qt.MouseEventNotSynthesized: #check if precision mouse(mac) # angle delta is 1/8th of a degree per scroll unit if self.zoom + QWheelEvent.angleDelta().y()/2880 > 0.1: # hit and trial value (2880) @@ -65,7 +65,7 @@ class customView(QGraphicsView): self.zoom += QWheelEvent.angleDelta().y() QWheelEvent.accept() # accept event so that scrolling doesnt happen simultaneously else: - return super().wheelEvent(self, QWheelEvent) # scroll if ctrl not pressed + return super(customView, self).wheelEvent(QWheelEvent) # scroll if ctrl not pressed @property def zoom(self): |