feat: support props.locked for setActiveTool (#7153)

Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
David Luzar 2023-10-20 13:16:23 +02:00 committed by GitHub
parent e7cc2337ea
commit 3697618266
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 67 additions and 5 deletions

View file

@ -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") {