summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextlayout.cpp
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-05-19 10:40:03 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2011-05-20 08:22:13 (GMT)
commitd80949eee06ff464d58bd97a6c89bae7e961f3c8 (patch)
tree760e1ba774d2cfcd9da4e7d2bee6c776cd1f86ed /src/gui/text/qtextlayout.cpp
parent29a6523dd8d3fac9be198c73153691c6dcdb3b21 (diff)
downloadQt-d80949eee06ff464d58bd97a6c89bae7e961f3c8.zip
Qt-d80949eee06ff464d58bd97a6c89bae7e961f3c8.tar.gz
Qt-d80949eee06ff464d58bd97a6c89bae7e961f3c8.tar.bz2
Fix ligature offset in multi-line text
Reviewed-by: Eskil
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 7328ea9..de4ca4f 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2505,8 +2505,8 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
if(pos == l)
x += si->width;
} else {
+ 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];
for (int i = glyph_end - 1; i >= glyph_pos; i--)
x += glyphs.effectiveAdvance(i);
@@ -2516,7 +2516,7 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
for (int i = glyph_start; i < glyph_pos; i++)
x += glyphs.effectiveAdvance(i);
}
- x += offsetInLigature(logClusters, glyphs, pos, line.length, glyph_pos);
+ x += offsetInLigature(logClusters, glyphs, pos, end, glyph_pos);
}
*cursorPos = pos + si->position;