Skip to content

Commit

Permalink
Paint text decoration where the text is
Browse files Browse the repository at this point in the history
For multi text-item texts we should render the text decoration at the
same position as the text-item part is, and not always from the
beginning of the line.

Task-number: QTBUG-60422
Change-Id: I9aa58fc164122ad1fae9716b8b18bdfbbbd778a9
Reviewed-by: Konstantin Ritt <[email protected]>
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
  • Loading branch information
Allan Sandfeld Jensen committed Dec 13, 2017
1 parent 9b597a0 commit ae55e75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/painting/qpainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6482,7 +6482,7 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText
extended->drawTextItem(QPointF(x, y), ti2);
else
engine->drawTextItem(QPointF(x, y), ti2);
drawTextItemDecoration(q, p, ti2.fontEngine, textEngine, ti2.underlineStyle,
drawTextItemDecoration(q, QPointF(x, y), ti2.fontEngine, textEngine, ti2.underlineStyle,
ti2.flags, ti2.width.toReal(), ti2.charFormat);

if (!rtl)
Expand Down Expand Up @@ -6515,7 +6515,7 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText
extended->drawTextItem(QPointF(x, y), ti2);
else
engine->drawTextItem(QPointF(x,y), ti2);
drawTextItemDecoration(q, p, ti2.fontEngine, textEngine, ti2.underlineStyle,
drawTextItemDecoration(q, QPointF(x, y), ti2.fontEngine, textEngine, ti2.underlineStyle,
ti2.flags, ti2.width.toReal(), ti2.charFormat);

// reset the high byte for all glyphs
Expand Down

0 comments on commit ae55e75

Please sign in to comment.