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
This commit is contained in:
Daniel Imms
2022-10-28 08:57:41 -07:00
parent e7b347a2ef
commit 8b545a3fe4
+1 -1
View File
@@ -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) {