chore: Laxing on invariants
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
35c986cbef
commit
fce13ccefd
@ -985,10 +985,13 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!this.state.multiElement) {
|
if (!this.state.multiElement) {
|
||||||
invariant(
|
if (
|
||||||
this.state.selectedLinearElement?.selectedPointsIndices?.length,
|
!this.state.selectedLinearElement ||
|
||||||
"There has to be at least one selected point to trigger bind mode change at arrow point drag",
|
!this.state.selectedLinearElement.selectedPointsIndices ||
|
||||||
);
|
!this.state.selectedLinearElement.selectedPointsIndices.length
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const startDragged =
|
const startDragged =
|
||||||
this.state.selectedLinearElement.selectedPointsIndices.includes(0);
|
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 { multiElement, selectedLinearElement } = this.state;
|
||||||
const { x: rx, y: ry, points } = multiElement;
|
const { x: rx, y: ry, points } = multiElement;
|
||||||
const lastPoint = points[points.length - 1];
|
const lastPoint = points[points.length - 1];
|
||||||
|
|
||||||
invariant(
|
|
||||||
selectedLinearElement,
|
|
||||||
"There must be a selected linear element instace",
|
|
||||||
);
|
|
||||||
|
|
||||||
const { lastCommittedPoint } = selectedLinearElement;
|
const { lastCommittedPoint } = selectedLinearElement;
|
||||||
|
|
||||||
setCursorForShape(this.interactiveCanvas, this.state);
|
setCursorForShape(this.interactiveCanvas, this.state);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user