summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextlayout.cpp
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2012-07-03 10:17:49 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-09 15:03:56 +0200
commitaee1702b136f5d7c332e9963a400ff9128bcb5b6 (patch)
tree9ca488993caaba1f92d03bfaadab89ea55096dd5 /src/gui/text/qtextlayout.cpp
parent43850e5295cf6ce94edce417bbb550cc2438dbd3 (diff)
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>
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-rw-r--r--src/gui/text/qtextlayout.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index b8be991fa1..c269eb2afd 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -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;