Fix cursor truncate to include line position
Since we could have moved the line position (QTextLine::setPosition), the truncating position should be adjusted with that. Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> (cherry picked from commit ca89c49fa2c5cbb3945897046f33eed9f7da846c) Change-Id: I89ea1a3776a50732181bdfea9e79b4dddef950d4 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
This commit is contained in:
parent
43850e5295
commit
aee1702b13
@ -2710,8 +2710,8 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
|
||||
x += eng->offsetInLigature(si, pos, end, glyph_pos);
|
||||
}
|
||||
|
||||
if (eng->option.wrapMode() != QTextOption::NoWrap && x > line.width)
|
||||
x = line.width;
|
||||
if (eng->option.wrapMode() != QTextOption::NoWrap && x > line.x + line.width)
|
||||
x = line.x + line.width;
|
||||
if (eng->option.wrapMode() != QTextOption::NoWrap && x < 0)
|
||||
x = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user