This commit is contained in:
kakkokari-gtyih 2025-05-24 19:04:49 +09:00
parent a95878ba1b
commit 67512e0b43
4 changed files with 6 additions and 8 deletions

View File

@ -437,10 +437,7 @@ function focus() {
function chooseFileFrom(ev) {
if (props.mock) return;
selectFile(ev.currentTarget ?? ev.target, {
label: i18n.ts.attachFile,
multiple: true,
}).then(files_ => {
selectFiles(ev.currentTarget ?? ev.target, i18n.ts.attachFile).then(files_ => {
for (const file of files_) {
files.value.push(file);
}

View File

@ -24,7 +24,8 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { } from 'vue';
import MkA, { type MkABehavior } from '@/components/global/MkA.vue';
import MkA from '@/components/global/MkA.vue';
import type { MkABehavior } from '@/components/global/MkA.vue';
const props = defineProps<{
to?: string;

View File

@ -64,7 +64,7 @@ const title = ref<string | null>(null);
const isSensitive = ref(false);
function chooseFile(evt) {
selectFile(evt.currentTarget ?? evt.target, { multiple: true }).then(selected => {
selectFiles(evt.currentTarget ?? evt.target).then(selected => {
files.value = files.value.concat(selected);
});
}

View File

@ -166,7 +166,7 @@ export function applyWatermark(img: string | Blob, el: HTMLCanvasElement | Offsc
if (config.repeat) {
// 余白をもたせた状態のウォーターマークを作成しておく(それをパターン繰り返しする)
const resizedWatermark = document.createElement('canvas');
const resizedWatermark = window.document.createElement('canvas');
resizedWatermark.width = width + (config.padding ? (config.padding.left ?? 0) + (config.padding.right ?? 0) : 0);
resizedWatermark.height = height + (config.padding ? (config.padding.top ?? 0) + (config.padding.bottom ?? 0) : 0);
const resizedCtx = resizedWatermark.getContext('2d')!;
@ -295,7 +295,7 @@ export function applyWatermark(img: string | Blob, el: HTMLCanvasElement | Offsc
* @returns Blob
*/
export async function getWatermarkAppliedImage(img: Blob, config: WatermarkConfig): Promise<Blob> {
const canvas = document.createElement('canvas');
const canvas = window.document.createElement('canvas');
await applyWatermark(img, canvas, config);
return new Promise(resolve => canvas.toBlob(blob => resolve(blob!)));
}