diff options
author | Liang Qi <liang.qi@nokia.com> | 2011-07-01 07:00:13 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2011-07-01 07:00:13 (GMT) |
commit | 3dc0c38389670d6adddd972c532af98dd6b5deb5 (patch) | |
tree | 779945938b51cc6290bc6dcee1cb34f696f42242 /src/gui/text/qstatictext.cpp | |
parent | 73f0d9534b593c65e4facf9a975e2c2e63608f03 (diff) | |
parent | f5feea56fc7202ab64a1b9c5f9b05391c2b88238 (diff) | |
download | Qt-3dc0c38389670d6adddd972c532af98dd6b5deb5.zip Qt-3dc0c38389670d6adddd972c532af98dd6b5deb5.tar.gz Qt-3dc0c38389670d6adddd972c532af98dd6b5deb5.tar.bz2 |
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts:
src/s60installs/s60installs.pro
Diffstat (limited to 'src/gui/text/qstatictext.cpp')
-rw-r--r-- | src/gui/text/qstatictext.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp index d8192b7..c985427 100644 --- a/src/gui/text/qstatictext.cpp +++ b/src/gui/text/qstatictext.cpp @@ -427,14 +427,17 @@ namespace { public: DrawTextItemRecorder(bool untransformedCoordinates, bool useBackendOptimizations) : m_dirtyPen(false), m_useBackendOptimizations(useBackendOptimizations), - m_untransformedCoordinates(untransformedCoordinates) + m_untransformedCoordinates(untransformedCoordinates), m_currentColor(Qt::black) { } virtual void updateState(const QPaintEngineState &newState) { - if (newState.state() & QPaintEngine::DirtyPen) + if (newState.state() & QPaintEngine::DirtyPen + && newState.pen().color() != m_currentColor) { m_dirtyPen = true; + m_currentColor = newState.pen().color(); + } } virtual void drawTextItem(const QPointF &position, const QTextItem &textItem) @@ -450,7 +453,7 @@ namespace { currentItem.positionOffset = m_glyphs.size(); // Offset into position pool currentItem.useBackendOptimizations = m_useBackendOptimizations; if (m_dirtyPen) - currentItem.color = state->pen().color(); + currentItem.color = m_currentColor; QTransform matrix = m_untransformedCoordinates ? QTransform() : state->transform(); matrix.translate(position.x(), position.y()); @@ -521,6 +524,7 @@ namespace { bool m_dirtyPen; bool m_useBackendOptimizations; bool m_untransformedCoordinates; + QColor m_currentColor; }; class DrawTextItemDevice: public QPaintDevice |