From 6f136de4cc979f9f2619b43d5093ce709897e8b7 Mon Sep 17 00:00:00 2001 From: Serhii Hrebeniuk <68051849+grebinka@users.noreply.github.com> Date: Wed, 10 Aug 2022 18:00:46 +0300 Subject: [PATCH] Fix jittering caused by incorrect BitmapText text width (#8536) --- packages/text-bitmap/src/BitmapText.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/text-bitmap/src/BitmapText.ts b/packages/text-bitmap/src/BitmapText.ts index 410f75de27..5df1143669 100644 --- a/packages/text-bitmap/src/BitmapText.ts +++ b/packages/text-bitmap/src/BitmapText.ts @@ -300,7 +300,8 @@ export class BitmapText extends Container chars.push(charRenderData); - lastLineWidth = charRenderData.position.x + Math.max(charData.xAdvance, charData.texture.orig.width); + lastLineWidth = charRenderData.position.x + + Math.max(charData.xAdvance - charData.xOffset, charData.texture.orig.width); pos.x += charData.xAdvance + this._letterSpacing; maxLineHeight = Math.max(maxLineHeight, (charData.yOffset + charData.texture.height)); prevCharCode = charCode;