fix sizeLimit reset after inpainting

This commit is contained in:
Qing 2022-05-27 23:14:49 +08:00
parent e4a6c91f4a
commit 544da231f6

View File

@ -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,