Update ImageToolPage.jsx via upload script - 2026-09-22 15:33:52

This commit is contained in:
mike 2026-09-22 15:34:03 +08:00
parent 325ae75c35
commit 9faac8dcab
1 changed files with 9 additions and 0 deletions

View File

@ -318,6 +318,15 @@ export function ImageToolPage() {
setBusy(false); setBusy(false);
} }
// 调logo位置/大小/透明度或者画布参数时,已经加进来的图自动重新画一遍预览,
// 不用每次都手动点"重新处理"——加了400ms防抖,不会拖滑块拖到一半就疯狂重算。
useEffect(() => {
if (items.length === 0) return undefined;
const timer = setTimeout(() => { reprocessAll(); }, 400);
return () => clearTimeout(timer);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [size, margin, quality, logoImage, logoSettings]);
async function handleExport() { async function handleExport() {
if (!items.length) { say('还没有图片', true); return; } if (!items.length) { say('还没有图片', true); return; }
setBusy(true); setBusy(true);