diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-05-20 10:26:54 +0200 |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-27 17:17:08 +0200 |
commit | 37f20ea8e64afa2d29d9fb56ac34ff405367a2b8 (patch) | |
tree | fcc136234369c34153bddd6961ddd4be4148b0b7 /src/gui | |
parent | 93339428c040a2576e4e0da315b1a6a4e4c1916f (diff) |
Fix ligature offset in multi-line text
Reviewed-by: Eskil
(cherry picked from commit 278cf1f37945050c4a46d5acab0659f3a7546a43)
Change-Id: Ice20aa38a49ea16cf56bd3705c7d400ee165a9c2
Reviewed-on: http://codereview.qt.nokia.com/195
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 9e067d763f..2e2a6234ae 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2609,8 +2609,8 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const } else { bool rtl = eng->isRightToLeft(); bool visual = eng->visualCursorMovement(); + int end = qMin(lineEnd, si->position + l) - si->position; if (reverse) { - int end = qMin(lineEnd, si->position + l) - si->position; int glyph_end = end == l ? si->num_glyphs : logClusters[end]; int glyph_start = glyph_pos; if (visual && !rtl && !(lastLine && itm == (visualOrder[nItems - 1] + firstItem))) @@ -2626,7 +2626,7 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const for (int i = glyph_start; i <= glyph_end; i++) x += glyphs.effectiveAdvance(i); } - x += eng->offsetInLigature(si, pos, line.length, glyph_pos); + x += eng->offsetInLigature(si, pos, end, glyph_pos); } *cursorPos = pos + si->position; |