From d8d5d49f04167d93dcdccb294b4c3d5d6fd3a0e7 Mon Sep 17 00:00:00 2001 From: Nils Nemitz Date: Sat, 27 Mar 2021 03:51:44 +0900 Subject: [PATCH] revert style change reduction in PlotDataItem --- pyqtgraph/graphicsItems/PlotDataItem.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyqtgraph/graphicsItems/PlotDataItem.py b/pyqtgraph/graphicsItems/PlotDataItem.py index a288427f..c85551a9 100644 --- a/pyqtgraph/graphicsItems/PlotDataItem.py +++ b/pyqtgraph/graphicsItems/PlotDataItem.py @@ -542,7 +542,6 @@ class PlotDataItem(GraphicsObject): if k in kargs: self.opts[k] = kargs[k] self._styleWasChanged = True - #curveArgs = {} #for k in ['pen', 'shadowPen', 'fillLevel', 'brush']: #if k in kargs: @@ -588,8 +587,14 @@ class PlotDataItem(GraphicsObject): profiler('emit') def updateItems(self, styleUpdate=True): + # override styleUpdate request and always enforce update until we have a better solution for + # - ScatterPlotItem losing per-point style information + # - PlotDataItem performing multiple unnecessary setData call on initialization + styleUpdate=True + curveArgs = {} scatterArgs = {} + if styleUpdate: # repeat style arguments only when changed for k,v in [('pen','pen'), ('shadowPen','shadowPen'), ('fillLevel','fillLevel'), ('fillOutline', 'fillOutline'), ('fillBrush', 'brush'), ('antialias', 'antialias'), ('connect', 'connect'), ('stepMode', 'stepMode')]: if k in self.opts: