Call GraphicsItem.viewTransformChanged() (#1413)

* Call GraphicsItem.viewTransformChanged()

* Needed to apply to labels too
This commit is contained in:
Ogi Moore 2020-10-22 11:17:33 -07:00 committed by GitHub
parent cff19f3271
commit 27ca1747f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@
from ..Qt import QtGui, QtCore
from ..Point import Point
from .GraphicsObject import GraphicsObject
from .GraphicsItem import GraphicsItem
from .TextItem import TextItem
from .ViewBox import ViewBox
from .. import functions as fn
@ -431,6 +432,7 @@ class InfiniteLine(GraphicsObject):
Called whenever the transformation matrix of the view has changed.
(eg, the view range has changed or the view was resized)
"""
GraphicsItem.viewTransformChanged(self)
self._invalidateCache()
def setName(self, name):
@ -607,6 +609,7 @@ class InfLineLabel(TextItem):
ev.acceptDrags(QtCore.Qt.LeftButton)
def viewTransformChanged(self):
GraphicsItem.viewTransformChanged(self)
self.updatePosition()
TextItem.viewTransformChanged(self)