mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
refactor: rename elementType to activeTool and make it an object (#4968)
* refactor: rename elementType to activeTool * update docs * fix snap * update activeToll to be an object and review fixes * fix tests * fix
This commit is contained in:
parent
2209e2c1e8
commit
127af9db23
25 changed files with 364 additions and 207 deletions
|
@ -68,8 +68,10 @@ export const actionClearCanvas = register({
|
|||
gridSize: appState.gridSize,
|
||||
showStats: appState.showStats,
|
||||
pasteDialog: appState.pasteDialog,
|
||||
elementType:
|
||||
appState.elementType === "image" ? "selection" : appState.elementType,
|
||||
activeTool:
|
||||
appState.activeTool.type === "image"
|
||||
? { type: "selection" }
|
||||
: appState.activeTool,
|
||||
},
|
||||
commitToHistory: true,
|
||||
};
|
||||
|
@ -299,7 +301,7 @@ export const actionErase = register({
|
|||
...appState,
|
||||
selectedElementIds: {},
|
||||
selectedGroupIds: {},
|
||||
elementType: isEraserActive(appState) ? "selection" : "eraser",
|
||||
activeTool: { type: isEraserActive(appState) ? "selection" : "eraser" },
|
||||
},
|
||||
commitToHistory: true,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue