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