Avoid implicit int conversion for mouse buttons

This commit is contained in:
Ogi Moore 2021-04-15 22:50:50 -07:00
parent 52de9554bb
commit 342fbb053f
2 changed files with 2 additions and 2 deletions

View File

@ -800,7 +800,7 @@ class ROI(GraphicsObject):
if ev.button() == QtCore.Qt.RightButton and self.contextMenuEnabled():
self.raiseContextMenu(ev)
ev.accept()
elif ev.button() & self.acceptedMouseButtons():
elif ev.button() in self.acceptedMouseButtons():
ev.accept()
self.sigClicked.emit(self, ev)
else:

View File

@ -1243,7 +1243,7 @@ class ViewBox(GraphicsWidget):
mask[1-axis] = 0.0
## Scale or translate based on mouse button
if ev.button() & (QtCore.Qt.LeftButton | QtCore.Qt.MiddleButton):
if ev.button() in [QtCore.Qt.LeftButton, QtCore.Qt.MiddleButton]:
if self.state['mouseMode'] == ViewBox.RectMode and axis is None:
if ev.isFinish(): ## This is the final move in the drag; change the view scale now
#print "finish"