diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 1e8cb9e478..15ae57da65 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2228,9 +2228,12 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const int glyphsEnd = (relativeTo == eng->length(&si)) ? si.num_glyphs - 1 : logClusters[relativeTo]; + // the glyph index right next to the requested range + int nextGlyphIndex = relativeTo < eng->length(&si) - 1 ? logClusters[relativeTo + 1] : si.num_glyphs; + if (nextGlyphIndex - 1 > glyphsEnd) + glyphsEnd = nextGlyphIndex - 1; bool startsInsideLigature = relativeFrom > 0 && logClusters[relativeFrom - 1] == glyphsStart; - bool endsInsideLigature = relativeTo < eng->length(&si) - 1 - && logClusters[relativeTo + 1] == glyphsEnd; + bool endsInsideLigature = nextGlyphIndex == glyphsEnd; int itemGlyphsStart = logClusters[iterator.itemStart - si.position]; int itemGlyphsEnd = logClusters[iterator.itemEnd - 1 - si.position]; |