Commit 01d62939 authored by Luke Campagnola's avatar Luke Campagnola
Browse files

Catch overflows from Point.length()

Merge branch 'release-0.9.8.1' into develop
parents 6b66edfd 44862727
......@@ -173,8 +173,14 @@ class PlotCurveItem(GraphicsObject):
if pxPad > 0:
# determine length of pixel in local x, y directions
px, py = self.pixelVectors()
px = 0 if px is None else px.length()
py = 0 if py is None else py.length()
try:
px = 0 if px is None else px.length()
except OverflowError:
px = 0
try:
py = 0 if py is None else py.length()
except OverflowError:
py = 0
# return bounds expanded by pixel size
px *= pxPad
......
......@@ -822,7 +822,10 @@ class ROI(GraphicsObject):
if not self.rotateAllowed:
return
## If the handle is directly over its center point, we can't compute an angle.
if lp1.length() == 0 or lp0.length() == 0:
try:
if lp1.length() == 0 or lp0.length() == 0:
return
except OverflowError:
return
## determine new rotation angle, constrained if necessary
......@@ -862,7 +865,10 @@ class ROI(GraphicsObject):
else:
scaleAxis = 0
if lp1.length() == 0 or lp0.length() == 0:
try:
if lp1.length() == 0 or lp0.length() == 0:
return
except OverflowError:
return
ang = newState['angle'] - lp0.angle(lp1)
......
......@@ -664,8 +664,14 @@ class ScatterPlotItem(GraphicsObject):
if pxPad > 0:
# determine length of pixel in local x, y directions
px, py = self.pixelVectors()
px = 0 if px is None else px.length()
py = 0 if py is None else py.length()
try:
px = 0 if px is None else px.length()
except OverflowError:
px = 0
try:
py = 0 if py is None else py.length()
except OverflowError:
py = 0
# return bounds expanded by pixel size
px *= pxPad
......
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