Skip to content

Commit

Permalink
fix: the error clip the last char when linebreak (#1745)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jocs committed Mar 29, 2024
1 parent f24fdb1 commit 009b5b4
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -129,6 +129,10 @@ function _divideOperator(

const sliceGlyphGroupWidth = __getGlyphGroupWidth(sliceGlyphGroup);
if (sliceGlyphGroupWidth > divide.width) {
// To avoid infinity loop when width is less than one char's width.
if (sliceGlyphGroup.length > 1) {
glyphGroup.unshift(sliceGlyphGroup.pop()!);
}
break;
}
}
Expand Down

0 comments on commit 009b5b4

Please sign in to comment.