Speed up ViewBox panning. Noticeable when a large number of items are present.

This commit is contained in:
dlidstrom 2015-03-14 22:06:05 -06:00
parent b700a1ad3d
commit 0908d98d65

View File

@ -1266,8 +1266,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