From 1ad3eacb7867dd5a02a6e8ec23b06085067680c0 Mon Sep 17 00:00:00 2001 From: Mikhail Terekhov Date: Thu, 20 Mar 2014 14:59:21 -0400 Subject: [PATCH] PlotCurveItem.boundingRect: check for None returned from self.dataBounds --- pyqtgraph/graphicsItems/PlotCurveItem.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyqtgraph/graphicsItems/PlotCurveItem.py b/pyqtgraph/graphicsItems/PlotCurveItem.py index a4ab3208..e312c272 100644 --- a/pyqtgraph/graphicsItems/PlotCurveItem.py +++ b/pyqtgraph/graphicsItems/PlotCurveItem.py @@ -194,8 +194,10 @@ class PlotCurveItem(GraphicsObject): def boundingRect(self): if self._boundingRect is None: (xmn, xmx) = self.dataBounds(ax=0) + if xmn is None or xmx is None: + return QtCore.QRectF() (ymn, ymx) = self.dataBounds(ax=1) - if xmn is None or ymn is None: + if ymn is None or ymx is None: return QtCore.QRectF() px = py = 0.0