summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextlayout.cpp
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-05-24 12:18:23 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2011-05-24 12:19:02 (GMT)
commit7214d84f3296a05e6db09f0ed12702b21c3fcb30 (patch)
tree261fcd93353c81fa54752cb216a7914fbb48e669 /src/gui/text/qtextlayout.cpp
parente5f38bb543696813a70995c90cd5450602c0356c (diff)
downloadQt-7214d84f3296a05e6db09f0ed12702b21c3fcb30.zip
Qt-7214d84f3296a05e6db09f0ed12702b21c3fcb30.tar.gz
Qt-7214d84f3296a05e6db09f0ed12702b21c3fcb30.tar.bz2
Fix xToCursor issue due to backporting from 4.8
Task-number: QTBUG-19260 Reviewed-by: TrustMe
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-rw-r--r--src/gui/text/qtextlayout.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 5857f33..a9179ed 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2659,6 +2659,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const
while (gs <= ge) {
if (glyphs.attributes[gs].clusterStart && qAbs(x-pos) < dist) {
glyph_pos = gs;
+ edge = pos;
dist = qAbs(x-pos);
}
pos -= glyphs.effectiveAdvance(gs);
@@ -2668,6 +2669,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const
while (gs <= ge) {
if (glyphs.attributes[gs].clusterStart && qAbs(x-pos) < dist) {
glyph_pos = gs;
+ edge = pos;
dist = qAbs(x-pos);
}
pos += glyphs.effectiveAdvance(gs);