From 0e816f1dbe12a1a80c6392c8cc980af7b760f9f5 Mon Sep 17 00:00:00 2001 From: Julius Juodakis Date: Sat, 21 Nov 2020 18:27:55 +1300 Subject: [PATCH] InfiniteLine caching calls merged (fixes #1450) (#1452) --- pyqtgraph/graphicsItems/InfiniteLine.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pyqtgraph/graphicsItems/InfiniteLine.py b/pyqtgraph/graphicsItems/InfiniteLine.py index 9cbf7229..c5726031 100644 --- a/pyqtgraph/graphicsItems/InfiniteLine.py +++ b/pyqtgraph/graphicsItems/InfiniteLine.py @@ -249,7 +249,7 @@ class InfiniteLine(GraphicsObject): if self.p != newPos: self.p = newPos - self._invalidateCache() + self.viewTransformChanged() GraphicsObject.setPos(self, Point(self.p)) self.sigPositionChanged.emit(self) @@ -293,9 +293,6 @@ class InfiniteLine(GraphicsObject): self.span = (mn, mx) self.update() - def _invalidateCache(self): - self._boundingRect = None - def _computeBoundingRect(self): #br = UIGraphicsItem.boundingRect(self) vr = self.viewRect() # bounds of containing ViewBox mapped to local coords. @@ -432,8 +429,8 @@ class InfiniteLine(GraphicsObject): Called whenever the transformation matrix of the view has changed. (eg, the view range has changed or the view was resized) """ + self._boundingRect = None GraphicsItem.viewTransformChanged(self) - self._invalidateCache() def setName(self, name): self._name = name