Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -379,6 +379,25 @@ export const useModelStore = create<ModelStore>((set, get) => ({
|
|||||||
|
|
||||||
scaleRatio: SCALE_PRESETS.find(p => p.label === '1:1')!,
|
scaleRatio: SCALE_PRESETS.find(p => p.label === '1:1')!,
|
||||||
setScaleRatio: (scaleRatio) => set({ scaleRatio }),
|
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,
|
opacity: 1,
|
||||||
setOpacity: (opacity) => set({ opacity }),
|
setOpacity: (opacity) => set({ opacity }),
|
||||||
|
|||||||
Reference in New Issue
Block a user