fix lint
This commit is contained in:
parent
a95878ba1b
commit
67512e0b43
|
@ -437,10 +437,7 @@ function focus() {
|
||||||
function chooseFileFrom(ev) {
|
function chooseFileFrom(ev) {
|
||||||
if (props.mock) return;
|
if (props.mock) return;
|
||||||
|
|
||||||
selectFile(ev.currentTarget ?? ev.target, {
|
selectFiles(ev.currentTarget ?? ev.target, i18n.ts.attachFile).then(files_ => {
|
||||||
label: i18n.ts.attachFile,
|
|
||||||
multiple: true,
|
|
||||||
}).then(files_ => {
|
|
||||||
for (const file of files_) {
|
for (const file of files_) {
|
||||||
files.value.push(file);
|
files.value.push(file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { } from 'vue';
|
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<{
|
const props = defineProps<{
|
||||||
to?: string;
|
to?: string;
|
||||||
|
|
|
@ -64,7 +64,7 @@ const title = ref<string | null>(null);
|
||||||
const isSensitive = ref(false);
|
const isSensitive = ref(false);
|
||||||
|
|
||||||
function chooseFile(evt) {
|
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);
|
files.value = files.value.concat(selected);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,7 @@ export function applyWatermark(img: string | Blob, el: HTMLCanvasElement | Offsc
|
||||||
|
|
||||||
if (config.repeat) {
|
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.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);
|
resizedWatermark.height = height + (config.padding ? (config.padding.top ?? 0) + (config.padding.bottom ?? 0) : 0);
|
||||||
const resizedCtx = resizedWatermark.getContext('2d')!;
|
const resizedCtx = resizedWatermark.getContext('2d')!;
|
||||||
|
@ -295,7 +295,7 @@ export function applyWatermark(img: string | Blob, el: HTMLCanvasElement | Offsc
|
||||||
* @returns ウォーターマークを適用した画像のBlob
|
* @returns ウォーターマークを適用した画像のBlob
|
||||||
*/
|
*/
|
||||||
export async function getWatermarkAppliedImage(img: Blob, config: WatermarkConfig): Promise<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);
|
await applyWatermark(img, canvas, config);
|
||||||
return new Promise(resolve => canvas.toBlob(blob => resolve(blob!)));
|
return new Promise(resolve => canvas.toBlob(blob => resolve(blob!)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue