Skip to content

Commit

Permalink
Fix jittering caused by incorrect BitmapText text width (pixijs#8536)
Browse files Browse the repository at this point in the history
  • Loading branch information
grebinka committed Aug 10, 2022
1 parent e514f65 commit 6f136de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/text-bitmap/src/BitmapText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6f136de

Please sign in to comment.