From 544da231f67e7ff6f0451cb2d5f705f8ef011ca7 Mon Sep 17 00:00:00 2001 From: Qing Date: Fri, 27 May 2022 23:14:49 +0800 Subject: [PATCH] fix sizeLimit reset after inpainting --- lama_cleaner/app/src/components/Editor/Editor.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lama_cleaner/app/src/components/Editor/Editor.tsx b/lama_cleaner/app/src/components/Editor/Editor.tsx index 4008587..9cebfe2 100644 --- a/lama_cleaner/app/src/components/Editor/Editor.tsx +++ b/lama_cleaner/app/src/components/Editor/Editor.tsx @@ -248,9 +248,6 @@ export default function Editor(props: EditorProps) { setMinScale(s) setScale(s) - const imageSizeLimit = Math.max(original.width, original.height) - setSizeLimit(imageSizeLimit) - if (context?.canvas) { context.canvas.width = original.naturalWidth context.canvas.height = original.naturalHeight @@ -260,6 +257,8 @@ export default function Editor(props: EditorProps) { if (!initialCentered) { viewportRef.current?.centerView(s, 1) setInitialCentered(true) + const imageSizeLimit = Math.max(original.width, original.height) + setSizeLimit(imageSizeLimit) } }, [ context?.canvas,