Fixed bitmapText kerning bug

This commit is contained in:
Zeke Chan 2024-06-19 13:55:41 +08:00
parent 0951a4a3d4
commit 9b2663774e

View file

@ -160,8 +160,9 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, camera, parentMatr
if (lastGlyph !== null)
{
var kerningOffset = glyph.kerning[lastCharCode];
x += (kerningOffset !== undefined) ? kerningOffset : 0;
var kerningOffset = glyph.kerning[lastCharCode] || 0;
x += kerningOffset;
xAdvance += kerningOffset;
}
xAdvance += glyph.xAdvance + letterSpacing;