Merge pull request #150 from lidstrom83/ViewBox_panning_fix

Speed up ViewBox panning
This commit is contained in:
Ogi Moore 2020-06-11 22:33:49 -07:00 committed by GitHub
commit 4b484ae46d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1280,8 +1280,10 @@ class ViewBox(GraphicsWidget):
## update shape of scale box
self.updateScaleBox(ev.buttonDownPos(), ev.pos())
else:
tr = dif*mask
tr = self.mapToView(tr) - self.mapToView(Point(0,0))
tr = self.childGroup.transform()
tr = fn.invertQTransform(tr)
tr = tr.map(dif*mask) - tr.map(Point(0,0))
x = tr.x() if mask[0] == 1 else None
y = tr.y() if mask[1] == 1 else None