InfiniteLine caching calls merged (fixes #1450) (#1452)

This commit is contained in:
Julius Juodakis 2020-11-21 18:27:55 +13:00 committed by GitHub
parent 5adb1b9a5b
commit 0e816f1dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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