feat(shortcut): area

This commit is contained in:
2026-04-20 09:36:34 +08:00
parent cad763d2a3
commit 04d530d692
8 changed files with 815 additions and 94 deletions

View File

@@ -45,6 +45,8 @@ interface TopToolsState {
setAssistToolEnabled: (val: boolean) => void
assistToolSize: number
setAssistToolSize: (val: number) => void
auxiliarySizeThreshold: number
setAuxiliarySizeThreshold: (val: number) => void
nodeSize: number
setNodeSize: (val: number) => void
showTags: boolean
@@ -107,6 +109,7 @@ const initialTopToolsState = {
crosshairStatus: "hidden" as "hidden" | "line" | "carve",
assistToolEnabled: false,
assistToolSize: 10,
auxiliarySizeThreshold: 0,
nodeSize: DEFAULT_NODE_SIZE,
drawOption: "default" as "default" | "intersect" | "unite",
saveCurrentScale: false,
@@ -197,6 +200,12 @@ export const useTopToolsStore = create<TopToolsState>()(
...state,
assistToolSize: Math.max(1, val),
})),
auxiliarySizeThreshold: initialTopToolsState.auxiliarySizeThreshold,
setAuxiliarySizeThreshold: (val) =>
set((state: TopToolsState) => ({
...state,
auxiliarySizeThreshold: Math.max(0, Number(val) || 0),
})),
nodeSize: initialTopToolsState.nodeSize,
setNodeSize: (val) =>
set((state: TopToolsState) => ({