summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-07-12 22:47:14 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-07-12 22:47:14 (GMT)
commitb9f33d6a4b3bfa161d75d40b2c8874135a08c861 (patch)
tree5b1614d0a7c1b9f6dccd4641187e97602b8051a8 /src
parentcb9a45c3d2655b44a6b40c45540f9b96dcaf1119 (diff)
parent2118a8df91263dcadd1ca0067caed84d1c749977 (diff)
downloadQt-b9f33d6a4b3bfa161d75d40b2c8874135a08c861.zip
Qt-b9f33d6a4b3bfa161d75d40b2c8874135a08c861.tar.gz
Qt-b9f33d6a4b3bfa161d75d40b2c8874135a08c861.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Compensate for different rounding rule in CG engine
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qpainter.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 604c1ab..754b16e 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -6335,10 +6335,16 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
QLineF line(pos.x(), pos.y(), pos.x() + width, pos.y());
- const qreal underlineOffset = fe->underlinePosition().toReal();
+ qreal underlineOffset = fe->underlinePosition().toReal();
+ qreal y = pos.y();
+ // compensate for different rounding rule in Core Graphics paint engine,
+ // ideally code like this should be moved to respective engines.
+ if (painter->paintEngine()->type() == QPaintEngine::CoreGraphics) {
+ y = qCeil(y);
+ }
// deliberately ceil the offset to avoid the underline coming too close to
// the text above it.
- const qreal underlinePos = pos.y() + qCeil(underlineOffset);
+ const qreal underlinePos = y + qCeil(underlineOffset);
if (underlineStyle == QTextCharFormat::SpellCheckUnderline) {
underlineStyle = QTextCharFormat::UnderlineStyle(QApplication::style()->styleHint(QStyle::SH_SpellCheckUnderlineStyle));