avoid division by zero when ViewBox has size or aspect = 0
This commit is contained in:
parent
f05c10a80f
commit
8deaf0866f
@ -1352,7 +1352,7 @@ class ViewBox(GraphicsWidget):
|
|||||||
aspect = self.state['aspectLocked'] # size ratio / view ratio
|
aspect = self.state['aspectLocked'] # size ratio / view ratio
|
||||||
tr = self.targetRect()
|
tr = self.targetRect()
|
||||||
bounds = self.rect()
|
bounds = self.rect()
|
||||||
if aspect is not False and tr.width() != 0 and bounds.width() != 0:
|
if aspect is not False and aspect != 0 and tr.height() != 0 and bounds.height() != 0:
|
||||||
|
|
||||||
## This is the view range aspect ratio we have requested
|
## This is the view range aspect ratio we have requested
|
||||||
targetRatio = tr.width() / tr.height()
|
targetRatio = tr.width() / tr.height()
|
||||||
|
Loading…
Reference in New Issue
Block a user