diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-05-20 08:26:54 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-05-20 08:27:50 (GMT) |
commit | 278cf1f37945050c4a46d5acab0659f3a7546a43 (patch) | |
tree | e83594badfe2969122d98fca9c35c2ea1104aa6e /src | |
parent | 6241e39cff9311c943430ff2f31236b13618f2ac (diff) | |
download | Qt-278cf1f37945050c4a46d5acab0659f3a7546a43.zip Qt-278cf1f37945050c4a46d5acab0659f3a7546a43.tar.gz Qt-278cf1f37945050c4a46d5acab0659f3a7546a43.tar.bz2 |
Fix ligature offset in multi-line text
Reviewed-by: Eskil
Diffstat (limited to 'src')
-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 07aeb72..9501c0b 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2559,8 +2559,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))) @@ -2576,7 +2576,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; |