fix: padding指定時のtop座標計算を修正

This commit is contained in:
kakkokari-gtyih 2024-12-17 09:54:33 +09:00
parent 9599fb73ad
commit 3deed56363

View file

@ -162,11 +162,11 @@ export async function applyWatermark(img: string | Blob, el: HTMLCanvasElement,
case 'center': case 'center':
case 'left': case 'left':
case 'right': case 'right':
return (canvas.height - height) / 2 + (config.padding ? config.padding.top ?? 0 : 0); return (canvas.height - height) / 2;
case 'top': case 'top':
case 'top-left': case 'top-left':
case 'top-right': case 'top-right':
return rotateY; return rotateY + (config.padding ? config.padding.top ?? 0 : 0);
case 'bottom': case 'bottom':
case 'bottom-left': case 'bottom-left':
case 'bottom-right': case 'bottom-right':