Skip to content

Commit

Permalink
Fix the character spacing error in the rendering of Label under Char …
Browse files Browse the repository at this point in the history
…Mode (#17925)
  • Loading branch information
smallmain authored Dec 27, 2024
1 parent b451e50 commit f462375
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cocos2d/core/renderer/utils/label/bmfont.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ export default class BmfontAssembler extends Assembler2D {
}
}

_clearHorizontalKerning() {
_horizontalKernings.length = 0;
}

_multilineTextWrap (nextTokenFunc) {
let textLen = _string.length;

Expand Down
6 changes: 5 additions & 1 deletion cocos2d/core/renderer/utils/label/letter-font.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,11 @@ export default class LetterFontAssembler extends WebglBmfontAssembler {

return fontDesc;
}
_computeHorizontalKerningForText () {}

_computeHorizontalKerningForText () {
this._clearHorizontalKerning();
}

_determineRect (tempRect) {
return false;
}
Expand Down

0 comments on commit f462375

Please sign in to comment.