Fix-cursor-truncate-to-include-line-position
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Tue, 5 Feb 2013 21:52:29 +0000 (21:52 +0000)
committerLisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>
Tue, 5 Feb 2013 21:52:29 +0000 (21:52 +0000)
Origin: commit ca89c49fa2c5cbb3945897046f33eed9f7da846c
Author: Jiang Jiang <jiang.jiang@nokia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Applied-Upstream: yes
Forwarded: not-needed

Gbp-Pq: Name Fix-cursor-truncate-to-include-line-position.patch

src/gui/text/qtextlayout.cpp

index 16f71502702bb4cbda819198ffefcae981074fd7..52f27935705aa80d1102d73883892b736bd2c934 100644 (file)
@@ -2616,8 +2616,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;
 
     *cursorPos = pos + si->position;
     return x.toReal();