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:
SamSchott 2020-03-06 15:02:39 +00:00 committed by GitHub
parent 6a2791e1c4
commit 3509d79c0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,7 +94,7 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
pen = fn.mkPen(*args, **kargs)
self.opts['pen'] = pen
self.paint()
self.update()
def brush(self):
return self.opts['brush']
@ -105,7 +105,7 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
return
self.opts['brush'] = brush
self.paint()
self.update()
def labelTextColor(self):
return self.opts['labelTextColor']
@ -120,7 +120,7 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
for sample, label in self.items:
label.setAttr('color', self.opts['labelTextColor'])
self.paint()
self.update()
def setParentItem(self, p):
ret = GraphicsWidget.setParentItem(self, p)