Fixed ViewBox error when accessing zoom history before having zoomed.
This commit is contained in:
parent
ab411012f8
commit
279ad1bee0
@ -1312,6 +1312,8 @@ class ViewBox(GraphicsWidget):
|
|||||||
ev.ignore()
|
ev.ignore()
|
||||||
|
|
||||||
def scaleHistory(self, d):
|
def scaleHistory(self, d):
|
||||||
|
if len(self.axHistory) == 0:
|
||||||
|
return
|
||||||
ptr = max(0, min(len(self.axHistory)-1, self.axHistoryPointer+d))
|
ptr = max(0, min(len(self.axHistory)-1, self.axHistoryPointer+d))
|
||||||
if ptr != self.axHistoryPointer:
|
if ptr != self.axHistoryPointer:
|
||||||
self.axHistoryPointer = ptr
|
self.axHistoryPointer = ptr
|
||||||
|
Loading…
Reference in New Issue
Block a user