diff options
Diffstat (limited to 'src/gui/text/qtextengine.cpp')
-rw-r--r-- | src/gui/text/qtextengine.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 2b0f9ffeb6..6345ed7682 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -3100,7 +3100,7 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end, glyph_pos--; } - const QCharAttributes *attrs = attributes(); + const QCharAttributes *attrs = attributes() + si->position; logClusters = this->logClusters(si); clusterLength = getClusterLength(logClusters, attrs, 0, end, glyph_pos, &clusterStart); @@ -3117,11 +3117,11 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end, int closestItem = dist > (perItemWidth / 2) ? n + 1 : n; if (cursorOnCharacter && closestItem > 0) closestItem--; - int pos = si->position + clusterStart + closestItem; + int pos = clusterStart + closestItem; // Jump to the next grapheme boundary while (pos < end && !attrs[pos].graphemeBoundary) pos++; - return pos; + return si->position + pos; } return si->position + end; } |