bug fix for setPen
, setBrush
, ...
Fixes a bug where `setPen`, `setBrush` and `setLabelTextColor` would fail because they call `LegendItem.paint` without a pen. They should instead call `LegendItem.update`.
This commit is contained in:
parent
6a2791e1c4
commit
3509d79c0f
@ -94,7 +94,7 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
|
|||||||
pen = fn.mkPen(*args, **kargs)
|
pen = fn.mkPen(*args, **kargs)
|
||||||
self.opts['pen'] = pen
|
self.opts['pen'] = pen
|
||||||
|
|
||||||
self.paint()
|
self.update()
|
||||||
|
|
||||||
def brush(self):
|
def brush(self):
|
||||||
return self.opts['brush']
|
return self.opts['brush']
|
||||||
@ -105,7 +105,7 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
|
|||||||
return
|
return
|
||||||
self.opts['brush'] = brush
|
self.opts['brush'] = brush
|
||||||
|
|
||||||
self.paint()
|
self.update()
|
||||||
|
|
||||||
def labelTextColor(self):
|
def labelTextColor(self):
|
||||||
return self.opts['labelTextColor']
|
return self.opts['labelTextColor']
|
||||||
@ -120,7 +120,7 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
|
|||||||
for sample, label in self.items:
|
for sample, label in self.items:
|
||||||
label.setAttr('color', self.opts['labelTextColor'])
|
label.setAttr('color', self.opts['labelTextColor'])
|
||||||
|
|
||||||
self.paint()
|
self.update()
|
||||||
|
|
||||||
def setParentItem(self, p):
|
def setParentItem(self, p):
|
||||||
ret = GraphicsWidget.setParentItem(self, p)
|
ret = GraphicsWidget.setParentItem(self, p)
|
||||||
|
Loading…
Reference in New Issue
Block a user