diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-04-19 12:40:19 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-04-26 08:17:21 (GMT) |
commit | 224226727f07e8940e0d3131fe7587b11cc4a6ca (patch) | |
tree | 9b5872759d3cf686f625fda271117d568f14b4f1 /src/gui/text/qtextlayout.cpp | |
parent | 1a1683c2d57debbb3e7f3ae6001eb2c8685dca02 (diff) | |
download | Qt-224226727f07e8940e0d3131fe7587b11cc4a6ca.zip Qt-224226727f07e8940e0d3131fe7587b11cc4a6ca.tar.gz Qt-224226727f07e8940e0d3131fe7587b11cc4a6ca.tar.bz2 |
Take leading space width into account for painting and selection
When painting horizontally centered RTL text and selection with
trailing spaces, we need to take that space width into account
because line.textAdvance doesn't include it.
Task-number: QTBUG-18612
Reviewed-by: Eskil
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index bd224c6..122382f 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1060,6 +1060,7 @@ void QTextLayout::draw(QPainter *p, const QPointF &pos, const QVector<FormatRang QRectF lineRect(tl.naturalTextRect()); lineRect.translate(position); + lineRect.adjust(0, 0, d->leadingSpaceWidth(sl).toReal(), 0); bool isLastLineInBlock = (line == d->lines.size()-1); int sl_length = sl.length + (isLastLineInBlock? 1 : 0); // the infamous newline |