From 0908d98d651324dc300bd8f5fd112b3e85e597f1 Mon Sep 17 00:00:00 2001 From: dlidstrom Date: Sat, 14 Mar 2015 22:06:05 -0600 Subject: [PATCH] Speed up ViewBox panning. Noticeable when a large number of items are present. --- pyqtgraph/graphicsItems/ViewBox/ViewBox.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py index 900c2038..c8db827b 100644 --- a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py +++ b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py @@ -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