diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-06-20 10:45:36 +0200 |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-20 13:08:48 +0200 |
commit | 18eb310d5bcbc4193bef0a5d45c01ed10f46579e (patch) | |
tree | 4706c81d0c2970daf4126a45d30ae87a05cd051a | |
parent | f562b90518137997f6e06765ebc550394a0bf114 (diff) |
Fix bug which caused repeated characters in a QML Text
We would include too much in the characters displayed, since
itemEnd is actually the start of the next item and not the
end of the current one. Adding a minus one removes the duplicated
characters at the end of text lines.
Change-Id: I1e13470548fafaa692ae58e019e9e2469a947f5e
Reviewed-on: http://codereview.qt.nokia.com/495
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
-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 781dd23a58..f9bfcbfce7 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2151,7 +2151,7 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const } int relativeFrom = qMax(iterator.itemStart, from) - si.position; - int relativeTo = qMin(iterator.itemEnd, from + length - 1) - si.position; + int relativeTo = qMin(iterator.itemEnd - 1, from + length - 1) - si.position; unsigned short *logClusters = eng->logClusters(&si); int glyphsStart = logClusters[relativeFrom]; @@ -2170,7 +2170,7 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const pos += QPointF((glyphLayout.advances_x[i] + justification).toReal(), glyphLayout.advances_y[i].toReal()); } - } else if (relativeTo != (iterator.itemEnd - si.position) && rtl) { + } else if (relativeTo != (iterator.itemEnd - si.position - 1) && rtl) { for (int i=glyphLayout.numGlyphs - 1; i>glyphsEnd; --i) { QFixed justification = QFixed::fromFixed(glyphLayout.justifications[i].space_18d6); pos += QPointF((glyphLayout.advances_x[i] + justification).toReal(), |