From e656366fabc1b42dd328afd1bfac4c90e5337ede Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Tue, 19 Mar 2013 20:54:05 -0400 Subject: [PATCH] fixed panning bug introduced in inp:274 --- pyqtgraph/graphicsItems/ViewBox/ViewBox.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py index b7785a9d..8769ed92 100644 --- a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py +++ b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py @@ -524,12 +524,13 @@ class ViewBox(GraphicsWidget): if t is not None: t = Point(t) self.setRange(vr.translated(t), padding=0) - elif x is not None: - x1, x2 = vr.left()+x, vr.right()+x - self.setXRange(x1, x2, padding=0) - elif y is not None: - y1, y2 = vr.top()+y, vr.bottom()+y - self.setYRange(y1, y2, padding=0) + else: + if x is not None: + x1, x2 = vr.left()+x, vr.right()+x + self.setXRange(x1, x2, padding=0) + if y is not None: + y1, y2 = vr.top()+y, vr.bottom()+y + self.setYRange(y1, y2, padding=0)