From 88bc2251555d5c92bb384a91cb28ad9d774bba0d Mon Sep 17 00:00:00 2001 From: Debian Qt/KDE Maintainers Date: Tue, 5 Feb 2013 21:52:29 +0000 Subject: [PATCH] Fix-cursor-truncate-to-include-line-position Origin: commit ca89c49fa2c5cbb3945897046f33eed9f7da846c Author: Jiang Jiang Reviewed-by: Eskil Abrahamsen Blomfeldt Applied-Upstream: yes Forwarded: not-needed Gbp-Pq: Name Fix-cursor-truncate-to-include-line-position.patch --- src/gui/text/qtextlayout.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 16f715027..52f279357 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -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(); -- 2.30.2