summaryrefslogtreecommitdiffstats
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-03-28 07:56:58 (GMT)
commiteeca1aee72a69584aa20bdb9f5c4e48d7e3cbc16 (patch)
tree659fa8cf204ab774bcb93abeda1740b4c15ea2f6
parentc61d6de8de9aa43ccdd49419b9a03af61cefde73 (diff)
downloadQt-eeca1aee72a69584aa20bdb9f5c4e48d7e3cbc16.zip
Qt-eeca1aee72a69584aa20bdb9f5c4e48d7e3cbc16.tar.gz
Qt-eeca1aee72a69584aa20bdb9f5c4e48d7e3cbc16.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. Reviewed-by: Jens Bache-Wiig
-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 14fb772..638f4ca 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));