From 55767c0141be1825e61cbead6109a6b1a42bccf9 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 21:10:38 +0000 Subject: [PATCH] Changes Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com> --- src/stores/useModelStore.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/stores/useModelStore.ts b/src/stores/useModelStore.ts index b34919e..8fb4c1a 100644 --- a/src/stores/useModelStore.ts +++ b/src/stores/useModelStore.ts @@ -379,6 +379,25 @@ export const useModelStore = create((set, get) => ({ scaleRatio: SCALE_PRESETS.find(p => p.label === '1:1')!, setScaleRatio: (scaleRatio) => set({ scaleRatio }), + scaleResetNonce: 0, + resetScale: () => set((state) => { + const oneToOne = SCALE_PRESETS.find(p => p.label === '1:1')!; + const activeId = state.activeModelId; + const models = activeId + ? state.models.map(m => m.id === activeId + ? { ...m, fineTuning: { ...m.fineTuning, scale: 1 } } + : m) + : state.models; + const active = models.find(m => m.id === activeId); + const fineTuning = active ? { ...active.fineTuning } : { ...state.fineTuning, scale: 1 }; + if (active) savePlacement(active.fileName, fineTuning); + return { + scaleRatio: oneToOne, + models, + fineTuning, + scaleResetNonce: state.scaleResetNonce + 1, + }; + }), opacity: 1, setOpacity: (opacity) => set({ opacity }),