This commit is contained in:
kakkokari-gtyih 2024-12-16 23:28:32 +09:00
parent dc197da055
commit 83b795d2f8
2 changed files with 2 additions and 3 deletions

View file

@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<div :class="$style.anchorGridRoot">
<div v-for="anchor in watermarkAnchor" :class="$style.anchorGridItem">
<input type="radio" :name="id" :id="`${id}-${anchor}`" :value="anchor" :class="$style.anchorGridItemRadio" v-model="value"/>
<input type="radio" :id="`${id}-${anchor}`" :name="id" :value="anchor" v-model="value" :class="$style.anchorGridItemRadio"/>
<label :for="`${id}-${anchor}`" :class="$style.anchorGridItemLabel">
<div :class="$style.anchorGridItemInner">{{ langMap[anchor] }}</div>
</label>

View file

@ -149,6 +149,7 @@ export async function applyWatermark(img: string | Blob, el: HTMLCanvasElement,
return canvas.width - width - (config.padding ? config.padding.right ?? 0 : 0);
}
})();
const y = (() => {
let rotateY = 0; // 回転によるY座標の補正
@ -172,7 +173,6 @@ export async function applyWatermark(img: string | Blob, el: HTMLCanvasElement,
return canvas.height - height - (config.padding ? config.padding.bottom ?? 0 : 0) - rotateY;
}
})();
if (config.rotate) {
const rotateRad = config.rotate * Math.PI / 180;
ctx.translate(x + width / 2, y + height / 2);
@ -194,7 +194,6 @@ export async function applyWatermark(img: string | Blob, el: HTMLCanvasElement,
watermark.src = config.__bypassMediaProxy ? config.fileUrl : getProxiedImageUrl(watermarkUrl, undefined, true);
}
}
};
if (typeof img === 'string') {
imgEl.src = img;