Correct ViewBox.translate to use setRange(x, y) when possible rather than making two calls.
This commit is contained in:
parent
96a4ff7cd5
commit
ea8079334f
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user