mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-13 12:29:58 +02:00
chore: Laxing on invariants
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
@@ -985,10 +985,13 @@ class App extends React.Component<AppProps, AppState> {
|
||||
);
|
||||
|
||||
if (!this.state.multiElement) {
|
||||
invariant(
|
||||
this.state.selectedLinearElement?.selectedPointsIndices?.length,
|
||||
"There has to be at least one selected point to trigger bind mode change at arrow point drag",
|
||||
);
|
||||
if (
|
||||
!this.state.selectedLinearElement ||
|
||||
!this.state.selectedLinearElement.selectedPointsIndices ||
|
||||
!this.state.selectedLinearElement.selectedPointsIndices.length
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const startDragged =
|
||||
this.state.selectedLinearElement.selectedPointsIndices.includes(0);
|
||||
@@ -6298,16 +6301,11 @@ class App extends React.Component<AppProps, AppState> {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.state.multiElement) {
|
||||
if (this.state.multiElement && this.state.selectedLinearElement) {
|
||||
const { multiElement, selectedLinearElement } = this.state;
|
||||
const { x: rx, y: ry, points } = multiElement;
|
||||
const lastPoint = points[points.length - 1];
|
||||
|
||||
invariant(
|
||||
selectedLinearElement,
|
||||
"There must be a selected linear element instace",
|
||||
);
|
||||
|
||||
const { lastCommittedPoint } = selectedLinearElement;
|
||||
|
||||
setCursorForShape(this.interactiveCanvas, this.state);
|
||||
|
Reference in New Issue
Block a user