fix(scale): fix
This commit is contained in:
@@ -62,6 +62,8 @@ interface TopToolsState {
|
||||
setSaveCurrentScale: (val: boolean) => void
|
||||
scale: number
|
||||
setScale: (val: number) => void
|
||||
displayedScale: number
|
||||
setDisplayedScale: (val: number) => void
|
||||
activeOperation: string
|
||||
setActiveOperation: (val: string) => void
|
||||
showObjectList: boolean
|
||||
@@ -114,6 +116,7 @@ const initialTopToolsState = {
|
||||
drawOption: "default" as "default" | "intersect" | "unite",
|
||||
saveCurrentScale: false,
|
||||
scale: 1,
|
||||
displayedScale: 1,
|
||||
activeOperation: "",
|
||||
showObjectList: false,
|
||||
showGroupList: false,
|
||||
@@ -248,6 +251,12 @@ export const useTopToolsStore = create<TopToolsState>()(
|
||||
...state,
|
||||
scale: val,
|
||||
})),
|
||||
displayedScale: initialTopToolsState.displayedScale,
|
||||
setDisplayedScale: (val: number) =>
|
||||
set((state: TopToolsState) => ({
|
||||
...state,
|
||||
displayedScale: Number.isFinite(val) && val > 0 ? val : 1,
|
||||
})),
|
||||
activeOperation: initialTopToolsState.activeOperation,
|
||||
setActiveOperation: (val: string) =>
|
||||
set((state: TopToolsState) => ({
|
||||
|
||||
Reference in New Issue
Block a user