diff --git a/pyqtgraph/graphicsItems/PlotCurveItem.py b/pyqtgraph/graphicsItems/PlotCurveItem.py index 28214552..5df78607 100644 --- a/pyqtgraph/graphicsItems/PlotCurveItem.py +++ b/pyqtgraph/graphicsItems/PlotCurveItem.py @@ -162,8 +162,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 diff --git a/pyqtgraph/graphicsItems/ROI.py b/pyqtgraph/graphicsItems/ROI.py index cb5f4f30..9ecc611b 100644 --- a/pyqtgraph/graphicsItems/ROI.py +++ b/pyqtgraph/graphicsItems/ROI.py @@ -664,7 +664,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 @@ -704,7 +707,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) diff --git a/pyqtgraph/graphicsItems/ScatterPlotItem.py b/pyqtgraph/graphicsItems/ScatterPlotItem.py index f1a5201d..2e620f9f 100644 --- a/pyqtgraph/graphicsItems/ScatterPlotItem.py +++ b/pyqtgraph/graphicsItems/ScatterPlotItem.py @@ -652,8 +652,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