From 70dde9c60e2ed9f8b9a15bc5c656fda972e69d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 25 Mar 2011 18:06:33 +0100 Subject: 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 --- src/gui/painting/qpainter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)); -- cgit v0.12