mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: support customType in activeTool (#5144)
* feat: support customType in activeTool * fix * rewrite types and handling * tweaks * fix Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
1ed1529f96
commit
64d330a332
12 changed files with 210 additions and 51 deletions
|
@ -15,7 +15,12 @@ import {
|
|||
} from "../scene";
|
||||
import { SHAPES } from "../shapes";
|
||||
import { AppState, Zoom } from "../types";
|
||||
import { capitalizeString, isTransparent, setCursorForShape } from "../utils";
|
||||
import {
|
||||
capitalizeString,
|
||||
isTransparent,
|
||||
updateActiveTool,
|
||||
setCursorForShape,
|
||||
} from "../utils";
|
||||
import Stack from "./Stack";
|
||||
import { ToolButton } from "./ToolButton";
|
||||
import { hasStrokeColor } from "../scene/comparisons";
|
||||
|
@ -229,7 +234,9 @@ export const ShapesSwitcher = ({
|
|||
if (appState.activeTool.type !== value) {
|
||||
trackEvent("toolbar", value, "ui");
|
||||
}
|
||||
const nextActiveTool = { ...activeTool, type: value };
|
||||
const nextActiveTool = updateActiveTool(appState, {
|
||||
type: value,
|
||||
});
|
||||
setAppState({
|
||||
activeTool: nextActiveTool,
|
||||
multiElement: null,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue