Skip to content

Commit

Permalink
Merge pull request #2760 from pijyoi/workaround-enum-invert
Browse files Browse the repository at this point in the history
workaround Python 3.11.4 flag inversion issue
  • Loading branch information
j9ac9k committed Jun 27, 2023
2 parents e3eb45b + 6534a3f commit 9b6408e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pyqtgraph/graphicsItems/ROI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,13 @@ def mouseDragEvent(self, ev):
if ev.isStart():
if ev.button() == QtCore.Qt.MouseButton.LeftButton:
roi.setSelected(True)
mods = ev.modifiers() & ~self.snapModifier
mods = ev.modifiers()
try:
mods &= ~self.snapModifier
except ValueError:
# workaround bug in Python 3.11.4 that affects PyQt
if mods & self.snapModifier:
mods ^= self.snapModifier
if roi.translatable and mods == self.translateModifier:
self.dragMode = 'translate'
elif roi.rotatable and mods == self.rotateModifier:
Expand Down

0 comments on commit 9b6408e

Please sign in to comment.