Commit ea807933 authored by Luke Campagnola's avatar Luke Campagnola
Browse files

Correct ViewBox.translate to use setRange(x, y) when possible rather than making two calls.

parent 96a4ff7c
...@@ -608,11 +608,10 @@ class ViewBox(GraphicsWidget): ...@@ -608,11 +608,10 @@ class ViewBox(GraphicsWidget):
self.setRange(vr.translated(t), padding=0) self.setRange(vr.translated(t), padding=0)
else: else:
if x is not None: if x is not None:
x1, x2 = vr.left()+x, vr.right()+x x = vr.left()+x, vr.right()+x
self.setXRange(x1, x2, padding=0)
if y is not None: if y is not None:
y1, y2 = vr.top()+y, vr.bottom()+y y = vr.top()+y, vr.bottom()+y
self.setYRange(y1, y2, padding=0) self.setRange(xRange=x, yRange=y, padding=0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment