From ea8079334fb3b013f3330c78375e1c6f168a8cde Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Wed, 6 Nov 2013 15:35:24 -0500 Subject: [PATCH] Correct ViewBox.translate to use setRange(x, y) when possible rather than making two calls. --- pyqtgraph/graphicsItems/ViewBox/ViewBox.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py index f0ea1e57..419b6306 100644 --- a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py +++ b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py @@ -608,11 +608,10 @@ class ViewBox(GraphicsWidget): self.setRange(vr.translated(t), padding=0) else: if x is not None: - x1, x2 = vr.left()+x, vr.right()+x - self.setXRange(x1, x2, padding=0) + x = vr.left()+x, vr.right()+x if y is not None: - y1, y2 = vr.top()+y, vr.bottom()+y - self.setYRange(y1, y2, padding=0) + y = vr.top()+y, vr.bottom()+y + self.setRange(xRange=x, yRange=y, padding=0)