mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-17 14:30:32 +02:00
fix: Locked tool + arrow
This commit is contained in:
@@ -134,6 +134,8 @@ export const actionFinalize = register<FormData>({
|
||||
});
|
||||
}
|
||||
|
||||
const activeToolLocked = appState.activeTool?.locked;
|
||||
console.log("finalize - activeToolLocked:", activeToolLocked);
|
||||
return {
|
||||
elements:
|
||||
element.points.length < 2 || isInvisiblySmallElement(element)
|
||||
@@ -147,15 +149,17 @@ export const actionFinalize = register<FormData>({
|
||||
appState: {
|
||||
...appState,
|
||||
cursorButton: "up",
|
||||
selectedLinearElement: {
|
||||
...linearElementEditor,
|
||||
selectedPointsIndices: null,
|
||||
isEditing: false,
|
||||
initialState: {
|
||||
...linearElementEditor.initialState,
|
||||
lastClickedPoint: -1,
|
||||
},
|
||||
},
|
||||
selectedLinearElement: activeToolLocked
|
||||
? null
|
||||
: {
|
||||
...linearElementEditor,
|
||||
selectedPointsIndices: null,
|
||||
isEditing: false,
|
||||
initialState: {
|
||||
...linearElementEditor.initialState,
|
||||
lastClickedPoint: -1,
|
||||
},
|
||||
},
|
||||
selectionElement: null,
|
||||
suggestedBinding: null,
|
||||
newElement: null,
|
||||
|
@@ -3194,14 +3194,14 @@ class App extends React.Component<AppProps, AppState> {
|
||||
this.setState({ editingTextElement: null });
|
||||
}
|
||||
|
||||
if (
|
||||
this.state.selectedLinearElement &&
|
||||
!this.state.selectedElementIds[this.state.selectedLinearElement.elementId]
|
||||
) {
|
||||
// To make sure `selectedLinearElement` is in sync with `selectedElementIds`, however this shouldn't be needed once
|
||||
// we have a single API to update `selectedElementIds`
|
||||
this.setState({ selectedLinearElement: null });
|
||||
}
|
||||
// if (
|
||||
// this.state.selectedLinearElement &&
|
||||
// !this.state.selectedElementIds[this.state.selectedLinearElement.elementId]
|
||||
// ) {
|
||||
// // To make sure `selectedLinearElement` is in sync with `selectedElementIds`, however this shouldn't be needed once
|
||||
// // we have a single API to update `selectedElementIds`
|
||||
// this.setState({ selectedLinearElement: null });
|
||||
// }
|
||||
|
||||
this.store.commit(elementsMap, this.state);
|
||||
|
||||
|
Reference in New Issue
Block a user