|
|
@ -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 })!; |
|
|
|