diff --git a/src/main.ts b/src/main.ts index 91e2d31..bda0cfc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -134,7 +134,8 @@ function imageFromCanvas(img: HTMLImageElement, bg: HTMLImageElement, off: numbe const scale = th / h; const canvas = document.createElement('canvas'); - canvas.width = w * scale + pw * 2; + const cw = w * scale + pw * 2; + canvas.width = cw >= 300 ? 300 : cw; canvas.height = th; const ctx = canvas.getContext('2d', { willReadFrequently: true })!;