slight changes in TextItem

This commit is contained in:
lesauxvi 2016-02-29 11:40:33 +01:00
parent 9d64b269d5
commit 865141ae49

View File

@ -50,6 +50,7 @@ class TextItem(GraphicsObject):
self._lastTransform = None
self._bounds = QtCore.QRectF()
if html is None:
self.color = color
self.setText(text, color)
else:
self.setHtml(html)
@ -63,6 +64,8 @@ class TextItem(GraphicsObject):
This method sets the plain text of the item; see also setHtml().
"""
if color != self.color:
color = self.color
color = fn.mkColor(color)
self.textItem.setDefaultTextColor(color)
self.textItem.setPlainText(text)