mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: support props.locked
for setActiveTool
(#7153)
Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
parent
e7cc2337ea
commit
3697618266
4 changed files with 67 additions and 5 deletions
|
@ -3249,7 +3249,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
});
|
||||
|
||||
setActiveTool = (
|
||||
tool:
|
||||
tool: (
|
||||
| (
|
||||
| { type: Exclude<ToolType, "image"> }
|
||||
| {
|
||||
|
@ -3257,7 +3257,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||
insertOnCanvasDirectly?: boolean;
|
||||
}
|
||||
)
|
||||
| { type: "custom"; customType: string },
|
||||
| { type: "custom"; customType: string }
|
||||
) & { locked?: boolean },
|
||||
) => {
|
||||
const nextActiveTool = updateActiveTool(this.state, tool);
|
||||
if (nextActiveTool.type === "hand") {
|
||||
|
@ -4714,7 +4715,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
pointerDownState,
|
||||
);
|
||||
} else if (this.state.activeTool.type === "custom") {
|
||||
setCursor(this.interactiveCanvas, CURSOR_TYPE.AUTO);
|
||||
setCursorForShape(this.interactiveCanvas, this.state);
|
||||
} else if (this.state.activeTool.type === "frame") {
|
||||
this.createFrameElementOnPointerDown(pointerDownState);
|
||||
} else if (this.state.activeTool.type === "laser") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue