summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextengine.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2012-10-23 13:14:27 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-25 14:10:04 +0200
commitde58eb64bc564fcb8af61a45576783e432d2380c (patch)
tree7521ec6ff5690f7b938fc558ae83a5d30ebf262a /src/gui/text/qtextengine.cpp
parent704a4e4747b2c42e262d9b4bd440ff365ab92a35 (diff)
Revert hacks in text rendering code path
There are a lot of hacks here and there in Qt trying to align the text in a correct way which caused regressions to appear once the default coordinate system changed. We need to remove these hacks to get a more consistent and maintainable base. This also fixes the regression introduced by changing the aliased coordinate system. Task-number: QTBUG-27667 Change-Id: I620db2ca23b7ff6c912f3a51e86e7e36bbef81f0 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/gui/text/qtextengine.cpp')
-rw-r--r--src/gui/text/qtextengine.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 38fe2f81409..025d4289aaa 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -3060,8 +3060,7 @@ void QTextEngine::drawItemDecorationList(QPainter *painter, const ItemDecoration
foreach (const ItemDecoration &decoration, decorationList) {
painter->setPen(decoration.pen);
- QLineF line(decoration.x1, decoration.y, decoration.x2, decoration.y);
- painter->drawLine(line);
+ painter->drawLine(QLineF(decoration.x1, decoration.y, decoration.x2, decoration.y));
}
}
@@ -3069,13 +3068,23 @@ void QTextEngine::drawDecorations(QPainter *painter)
{
QPen oldPen = painter->pen();
+ bool wasCompatiblePainting = painter->renderHints()
+ & QPainter::Qt4CompatiblePainting;
+
+ if (wasCompatiblePainting)
+ painter->setRenderHint(QPainter::Qt4CompatiblePainting, false);
+
adjustUnderlines();
drawItemDecorationList(painter, underlineList);
drawItemDecorationList(painter, strikeOutList);
drawItemDecorationList(painter, overlineList);
- painter->setPen(oldPen);
clearDecorations();
+
+ if (wasCompatiblePainting)
+ painter->setRenderHint(QPainter::Qt4CompatiblePainting);
+
+ painter->setPen(oldPen);
}
void QTextEngine::clearDecorations()