Merge pull request #1174 from Ma-Shell/develop

Fixed a possible race condition with linked views
This commit is contained in:
Ogi Moore 2020-05-29 23:00:10 -07:00 committed by GitHub
commit 99c43613f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1110,23 +1110,26 @@ class AxisItem(GraphicsWidget):
self._updateHeight()
def wheelEvent(self, ev):
if self.linkedView() is None:
lv = self.linkedView()
if lv is None:
return
if self.orientation in ['left', 'right']:
self.linkedView().wheelEvent(ev, axis=1)
lv.wheelEvent(ev, axis=1)
else:
self.linkedView().wheelEvent(ev, axis=0)
lv.wheelEvent(ev, axis=0)
ev.accept()
def mouseDragEvent(self, event):
if self.linkedView() is None:
lv = self.linkedView()
if lv is None:
return
if self.orientation in ['left', 'right']:
return self.linkedView().mouseDragEvent(event, axis=1)
return lv.mouseDragEvent(event, axis=1)
else:
return self.linkedView().mouseDragEvent(event, axis=0)
return lv.mouseDragEvent(event, axis=0)
def mouseClickEvent(self, event):
if self.linkedView() is None:
lv = self.linkedView()
if lv is None:
return
return self.linkedView().mouseClickEvent(event)
return lv.mouseClickEvent(event)