From d2ab40f8c3ba0f13dc15ca8286afea291140d8ec Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 23 Mar 2011 16:51:41 +0100 Subject: qFloor the decoration line width before painting It's a special case when enabling design (fractional) metrics, we need to floor it to keep consistency with integer metrics. Reviewed-by: Eskil --- src/gui/painting/qpainter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index b1f5f4c..14fb772 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -6463,7 +6463,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const pen.setWidthF(fe->lineThickness().toReal()); pen.setCapStyle(Qt::FlatCap); - QLineF line(pos.x(), pos.y(), pos.x() + width, pos.y()); + QLineF line(pos.x(), pos.y(), pos.x() + qFloor(width), pos.y()); const qreal underlineOffset = fe->underlinePosition().toReal(); // deliberately ceil the offset to avoid the underline coming too close to -- cgit v0.12