1 commit ca89c49fa2c5cbb3945897046f33eed9f7da846c
2 Author: Jiang Jiang <jiang.jiang@nokia.com>
3 Date: Tue Jul 3 10:17:49 2012 +0200
5 Fix cursor truncate to include line position
7 Since we could have moved the line position (QTextLine::setPosition),
8 the truncating position should be adjusted with that.
10 Change-Id: Ie1acd4a1b6a4adfbeeb9ce8ee2dfa19d992470e8
11 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
13 diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
14 index 16f7150..52f2793 100644
15 --- a/src/gui/text/qtextlayout.cpp
16 +++ b/src/gui/text/qtextlayout.cpp
17 @@ -2616,8 +2616,8 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
18 x += eng->offsetInLigature(si, pos, end, glyph_pos);
21 - if (eng->option.wrapMode() != QTextOption::NoWrap && x > line.width)
23 + if (eng->option.wrapMode() != QTextOption::NoWrap && x > line.x + line.width)
24 + x = line.x + line.width;
26 *cursorPos = pos + si->position;