From 8b545a3fe4b58fbfc262f9777d18bd1b318edbbe Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Fri, 28 Oct 2022 08:57:41 -0700 Subject: [PATCH] Fix bbox right scan start offset This causes particularly wide glyphs like italic emoji to get clipped even if they're within the allowed padding. Fixes #4229 --- src/browser/renderer/shared/TextureAtlas.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/renderer/shared/TextureAtlas.ts b/src/browser/renderer/shared/TextureAtlas.ts index 23deb8a3..d59ee64e 100644 --- a/src/browser/renderer/shared/TextureAtlas.ts +++ b/src/browser/renderer/shared/TextureAtlas.ts @@ -730,7 +730,7 @@ export class TextureAtlas implements ITextureAtlas { } boundingBox.right = width; found = false; - for (let x = width - 1; x >= 0; x--) { + for (let x = padding + width - 1; x >= 0; x--) { for (let y = 0; y < height; y++) { const alphaOffset = y * this._tmpCanvas.width * 4 + x * 4 + 3; if (imageData.data[alphaOffset] !== 0) {