mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-16 22:10:48 +02:00
chore: Attempt filtering new set state
This commit is contained in:
@@ -492,10 +492,9 @@ export class LinearElementEditor {
|
||||
};
|
||||
|
||||
return {
|
||||
...app.state,
|
||||
selectedLinearElement: newLinearElementEditor,
|
||||
suggestedBindings,
|
||||
};
|
||||
} as Pick<AppState, keyof AppState>;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@@ -8861,7 +8861,22 @@ class App extends React.Component<AppProps, AppState> {
|
||||
pointerDownState.lastCoords.y = y;
|
||||
pointerDownState.drag.hasOccurred = true;
|
||||
|
||||
this.setState(newState);
|
||||
if (
|
||||
!isShallowEqual(
|
||||
newState.suggestedBindings ?? [],
|
||||
this.state.suggestedBindings,
|
||||
) ||
|
||||
!isShallowEqual(
|
||||
newState.selectedLinearElement?.selectedPointsIndices ?? [],
|
||||
this.state.selectedLinearElement?.selectedPointsIndices ?? [],
|
||||
) ||
|
||||
newState.selectedLinearElement?.hoverPointIndex !==
|
||||
this.state.selectedLinearElement?.hoverPointIndex ||
|
||||
newState.selectedLinearElement?.customLineAngle !==
|
||||
this.state.selectedLinearElement?.customLineAngle
|
||||
) {
|
||||
this.setState(newState);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user