Merge pull request #1498 from jjuod/scrollingplotfix

PlotDataItem now signals on setPos (fix #1494)
This commit is contained in:
Ogi Moore 2021-01-13 13:16:31 -08:00 committed by GitHub
commit 4abbc2d5cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,6 +217,13 @@ class PlotDataItem(GraphicsObject):
def boundingRect(self):
return QtCore.QRectF() ## let child items handle this
def setPos(self, x, y):
GraphicsObject.setPos(self, x, y)
# to update viewRect:
self.viewTransformChanged()
# to update displayed point sets, e.g. when clipping (which uses viewRect):
self.viewRangeChanged()
def setAlpha(self, alpha, auto):
if self.opts['alphaHint'] == alpha and self.opts['alphaMode'] == auto:
return
@ -552,7 +559,6 @@ class PlotDataItem(GraphicsObject):
profiler('emit')
def updateItems(self):
curveArgs = {}
for k,v in [('pen','pen'), ('shadowPen','shadowPen'), ('fillLevel','fillLevel'), ('fillOutline', 'fillOutline'), ('fillBrush', 'brush'), ('antialias', 'antialias'), ('connect', 'connect'), ('stepMode', 'stepMode')]:
curveArgs[v] = self.opts[k]