mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-08-19 00:07:07 +02:00
fix: Remove flushSync from alt-lasso and elbow dragging (#9734)
* Remove lasso flushSync * Remove selectedLinearElement flushSync * Early return
This commit is contained in:
@@ -8095,8 +8095,6 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
this.scene,
|
this.scene,
|
||||||
);
|
);
|
||||||
|
|
||||||
flushSync(() => {
|
|
||||||
if (this.state.selectedLinearElement) {
|
|
||||||
this.setState({
|
this.setState({
|
||||||
selectedLinearElement: {
|
selectedLinearElement: {
|
||||||
...this.state.selectedLinearElement,
|
...this.state.selectedLinearElement,
|
||||||
@@ -8104,8 +8102,6 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
pointerDownState: ret.pointerDownState,
|
pointerDownState: ret.pointerDownState,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8618,7 +8614,6 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
pointerDownState.lastCoords.x = pointerCoords.x;
|
pointerDownState.lastCoords.x = pointerCoords.x;
|
||||||
pointerDownState.lastCoords.y = pointerCoords.y;
|
pointerDownState.lastCoords.y = pointerCoords.y;
|
||||||
if (event.altKey) {
|
if (event.altKey) {
|
||||||
flushSync(() => {
|
|
||||||
this.setActiveTool(
|
this.setActiveTool(
|
||||||
{ type: "lasso", fromSelection: true },
|
{ type: "lasso", fromSelection: true },
|
||||||
event.shiftKey,
|
event.shiftKey,
|
||||||
@@ -8631,10 +8626,9 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
this.setAppState({
|
this.setAppState({
|
||||||
selectionElement: null,
|
selectionElement: null,
|
||||||
});
|
});
|
||||||
});
|
return;
|
||||||
} else {
|
|
||||||
this.maybeDragNewGenericElement(pointerDownState, event);
|
|
||||||
}
|
}
|
||||||
|
this.maybeDragNewGenericElement(pointerDownState, event);
|
||||||
} else if (this.state.activeTool.type === "lasso") {
|
} else if (this.state.activeTool.type === "lasso") {
|
||||||
if (!event.altKey && this.state.activeTool.fromSelection) {
|
if (!event.altKey && this.state.activeTool.fromSelection) {
|
||||||
this.setActiveTool({ type: "selection" });
|
this.setActiveTool({ type: "selection" });
|
||||||
|
Reference in New Issue
Block a user