fix sizeLimit reset after inpainting
This commit is contained in:
parent
e4a6c91f4a
commit
544da231f6
@ -248,9 +248,6 @@ export default function Editor(props: EditorProps) {
|
|||||||
setMinScale(s)
|
setMinScale(s)
|
||||||
setScale(s)
|
setScale(s)
|
||||||
|
|
||||||
const imageSizeLimit = Math.max(original.width, original.height)
|
|
||||||
setSizeLimit(imageSizeLimit)
|
|
||||||
|
|
||||||
if (context?.canvas) {
|
if (context?.canvas) {
|
||||||
context.canvas.width = original.naturalWidth
|
context.canvas.width = original.naturalWidth
|
||||||
context.canvas.height = original.naturalHeight
|
context.canvas.height = original.naturalHeight
|
||||||
@ -260,6 +257,8 @@ export default function Editor(props: EditorProps) {
|
|||||||
if (!initialCentered) {
|
if (!initialCentered) {
|
||||||
viewportRef.current?.centerView(s, 1)
|
viewportRef.current?.centerView(s, 1)
|
||||||
setInitialCentered(true)
|
setInitialCentered(true)
|
||||||
|
const imageSizeLimit = Math.max(original.width, original.height)
|
||||||
|
setSizeLimit(imageSizeLimit)
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
context?.canvas,
|
context?.canvas,
|
||||||
|
Loading…
Reference in New Issue
Block a user