slight changes in TextItem
This commit is contained in:
parent
9d64b269d5
commit
865141ae49
@ -50,6 +50,7 @@ class TextItem(GraphicsObject):
|
|||||||
self._lastTransform = None
|
self._lastTransform = None
|
||||||
self._bounds = QtCore.QRectF()
|
self._bounds = QtCore.QRectF()
|
||||||
if html is None:
|
if html is None:
|
||||||
|
self.color = color
|
||||||
self.setText(text, color)
|
self.setText(text, color)
|
||||||
else:
|
else:
|
||||||
self.setHtml(html)
|
self.setHtml(html)
|
||||||
@ -63,6 +64,8 @@ class TextItem(GraphicsObject):
|
|||||||
|
|
||||||
This method sets the plain text of the item; see also setHtml().
|
This method sets the plain text of the item; see also setHtml().
|
||||||
"""
|
"""
|
||||||
|
if color != self.color:
|
||||||
|
color = self.color
|
||||||
color = fn.mkColor(color)
|
color = fn.mkColor(color)
|
||||||
self.textItem.setDefaultTextColor(color)
|
self.textItem.setDefaultTextColor(color)
|
||||||
self.textItem.setPlainText(text)
|
self.textItem.setPlainText(text)
|
||||||
@ -182,4 +185,4 @@ class TextItem(GraphicsObject):
|
|||||||
|
|
||||||
self.updateTextPos()
|
self.updateTextPos()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user