From cafd97e5bceb9812c65eb4f785f59d49bbc304d6 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sun, 9 Jul 2023 23:24:15 +1200 Subject: [PATCH] fix: Reset handler not adjusting correctly --- .../parameters/components/Parameters/Core/ParamHeight.tsx | 4 ++-- .../parameters/components/Parameters/Core/ParamWidth.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/Core/ParamHeight.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/Core/ParamHeight.tsx index 617fe07fc5..8d0c6fbb6e 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Parameters/Core/ParamHeight.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/Core/ParamHeight.tsx @@ -55,8 +55,8 @@ const ParamHeight = (props: ParamHeightProps) => { const handleReset = useCallback(() => { dispatch(setHeight(initial)); - if (aspectRatio) dispatch(setWidth(roundToEight(height * aspectRatio))); - }, [dispatch, initial, height, aspectRatio]); + if (aspectRatio) dispatch(setWidth(roundToEight(initial * aspectRatio))); + }, [dispatch, initial, aspectRatio]); return ( { const handleReset = useCallback(() => { dispatch(setWidth(initial)); - if (aspectRatio) dispatch(setHeight(roundToEight(width / aspectRatio))); - }, [dispatch, initial, width, aspectRatio]); + if (aspectRatio) dispatch(setHeight(roundToEight(initial / aspectRatio))); + }, [dispatch, initial, aspectRatio]); return (