diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-12-01 01:29:23 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-12-01 01:31:47 (GMT) |
commit | fe90d7a3d9f00fa2ea46c0816f63c65f812c360f (patch) | |
tree | c0f286d64a27e0f5269543d43e06cd33135792cb /src/declarative | |
parent | 6f18ee7ce50bc9b2688079e923a34c08117b3eb8 (diff) | |
download | Qt-fe90d7a3d9f00fa2ea46c0816f63c65f812c360f.zip Qt-fe90d7a3d9f00fa2ea46c0816f63c65f812c360f.tar.gz Qt-fe90d7a3d9f00fa2ea46c0816f63c65f812c360f.tar.bz2 |
Change pen correctly when drawing cached text
Task-number: QTBUG-14568
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextlayout.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp index e8da367..14a1109 100644 --- a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp @@ -361,10 +361,18 @@ void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p) d->position = p; } + QPen oldPen = priv->state->pen; + QColor currentColor = oldPen.color(); for (int ii = 0; ii < itemCount; ++ii) { QStaticTextItem &item = d->items[ii]; + if (item.color.isValid() && currentColor != item.color) { + painter->setPen(item.color); + currentColor = item.color; + } priv->extended->drawStaticTextItem(&item); } + if (currentColor != oldPen.color()) + painter->setPen(oldPen); } QT_END_NAMESPACE |