fix: Remove flushSync from alt-lasso and elbow dragging (#9734)

* Remove lasso flushSync

* Remove selectedLinearElement flushSync

* Early return
This commit is contained in:
Omar Brikaa
2025-07-24 00:39:16 +03:00
committed by GitHub
parent e5e07260c6
commit f38f381989

View File

@@ -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" });