can shape edit + when add shape is default selected

This commit is contained in:
hamid zarghami
2025-11-26 14:16:52 +03:30
parent 3454129dca
commit aacf209894
7 changed files with 120 additions and 29 deletions
+5 -1
View File
@@ -59,7 +59,11 @@ type EditorStoreType = {
export const useEditorStore = create<EditorStoreType>((set) => ({
tool: "select",
setTool: (tool) => set({ tool }),
setTool: (tool) =>
set((state) => ({
tool,
selectedObjectId: tool === "select" ? state.selectedObjectId : null,
})),
objects: [],
addObject: (object) =>
set((state) => ({ objects: [...state.objects, object] })),