Speed up PlotCurveItem in some cases (avoid drawing shadow when it is not needed)
This commit is contained in:
parent
22007061eb
commit
55462dc2d6
|
@ -426,10 +426,12 @@ class PlotCurveItem(GraphicsObject):
|
||||||
p.fillPath(self.fillPath, self.opts['brush'])
|
p.fillPath(self.fillPath, self.opts['brush'])
|
||||||
prof.mark('draw fill path')
|
prof.mark('draw fill path')
|
||||||
|
|
||||||
|
sp = fn.mkPen(self.opts['shadowPen'])
|
||||||
|
cp = fn.mkPen(self.opts['pen'])
|
||||||
|
|
||||||
## Copy pens and apply alpha adjustment
|
## Copy pens and apply alpha adjustment
|
||||||
sp = QtGui.QPen(self.opts['shadowPen'])
|
#sp = QtGui.QPen(self.opts['shadowPen'])
|
||||||
cp = QtGui.QPen(self.opts['pen'])
|
#cp = QtGui.QPen(self.opts['pen'])
|
||||||
#for pen in [sp, cp]:
|
#for pen in [sp, cp]:
|
||||||
#if pen is None:
|
#if pen is None:
|
||||||
#continue
|
#continue
|
||||||
|
|
|
@ -379,9 +379,6 @@ class PlotDataItem(GraphicsObject):
|
||||||
|
|
||||||
|
|
||||||
def updateItems(self):
|
def updateItems(self):
|
||||||
#for c in self.curves+self.scatters:
|
|
||||||
#if c.scene() is not None:
|
|
||||||
#c.scene().removeItem(c)
|
|
||||||
|
|
||||||
curveArgs = {}
|
curveArgs = {}
|
||||||
for k,v in [('pen','pen'), ('shadowPen','shadowPen'), ('fillLevel','fillLevel'), ('fillBrush', 'brush'), ('antialias', 'antialias')]:
|
for k,v in [('pen','pen'), ('shadowPen','shadowPen'), ('fillLevel','fillLevel'), ('fillBrush', 'brush'), ('antialias', 'antialias')]:
|
||||||
|
@ -399,18 +396,12 @@ class PlotDataItem(GraphicsObject):
|
||||||
self.curve.show()
|
self.curve.show()
|
||||||
else:
|
else:
|
||||||
self.curve.hide()
|
self.curve.hide()
|
||||||
#curve = PlotCurveItem(x=x, y=y, **curveArgs)
|
|
||||||
#curve.setParentItem(self)
|
|
||||||
#self.curves.append(curve)
|
|
||||||
|
|
||||||
if scatterArgs['symbol'] is not None:
|
if scatterArgs['symbol'] is not None:
|
||||||
self.scatter.setData(x=x, y=y, **scatterArgs)
|
self.scatter.setData(x=x, y=y, **scatterArgs)
|
||||||
self.scatter.show()
|
self.scatter.show()
|
||||||
else:
|
else:
|
||||||
self.scatter.hide()
|
self.scatter.hide()
|
||||||
#sp = ScatterPlotItem(x=x, y=y, **scatterArgs)
|
|
||||||
#sp.setParentItem(self)
|
|
||||||
#self.scatters.append(sp)
|
|
||||||
|
|
||||||
|
|
||||||
def getData(self):
|
def getData(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user