Skip to content

Commit

Permalink
fix(troika-three-text): fill in missing caret positions when the fina…
Browse files Browse the repository at this point in the history
…l glyph is a ligature - #165
  • Loading branch information
lojjic committed Nov 10, 2021
1 parent 0d775b1 commit ad2eda6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/troika-three-text/src/worker/Typesetter.js
Expand Up @@ -511,6 +511,14 @@ export function createTypesetter(fontParser, bidi, config) {
// Increment y offset for next line
lineYOffset -= lineHeight
})

// Fill in remaining caret positions in case the final character was a ligature
if (caretPositions) {
const ligCount = text.length - prevCharIndex;
if (ligCount > 1) {
fillLigatureCaretPositions(caretPositions, prevCharIndex, ligCount)
}
}
}

// Timing stats
Expand Down

0 comments on commit ad2eda6

Please sign in to comment.