summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-03-25 17:06:33 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2011-04-01 11:48:05 (GMT)
commit70dde9c60e2ed9f8b9a15bc5c656fda972e69d97 (patch)
treeaca5ae09500e53fa9fd71be52039e4100b65d934 /src/gui/painting
parent0c214f948cf3520b42bc0d3f1adaa284dc2f3880 (diff)
downloadQt-70dde9c60e2ed9f8b9a15bc5c656fda972e69d97.zip
Qt-70dde9c60e2ed9f8b9a15bc5c656fda972e69d97.tar.gz
Qt-70dde9c60e2ed9f8b9a15bc5c656fda972e69d97.tar.bz2
Fixed underline offset after raster coordinate system change.
This avoids the double-thickness lines at low point sizes which were caused by a line just barely straddling two pixels. Re-applying eeca1aee72a69584aa20bdb9f5c4e48d7e3cbc16. Reviewed-by: Jens Bache-Wiig
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpainter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 64ef549..50d65e6 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -6468,7 +6468,8 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
const qreal underlineOffset = fe->underlinePosition().toReal();
// 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 aliasedCoordinateDelta = 0.5 - 0.015625;
+ const qreal underlinePos = pos.y() + qCeil(underlineOffset) - aliasedCoordinateDelta;
if (underlineStyle == QTextCharFormat::SpellCheckUnderline) {
underlineStyle = QTextCharFormat::UnderlineStyle(QApplication::style()->styleHint(QStyle::SH_SpellCheckUnderlineStyle));