fix: Finalize multipoint arrow on binding area click

This commit is contained in:
Mark Tolmacs
2025-11-12 14:57:28 +01:00
parent 344aa48a90
commit 238911d577

View File

@@ -6369,6 +6369,7 @@ class App extends React.Component<AppProps, AppState> {
pointFrom<GlobalPoint>(scenePointerX, scenePointerY),
this.scene.getNonDeletedElements(),
this.scene.getNonDeletedElementsMap(),
(el) => maxBindingDistance_simple(this.state.zoom),
);
if (hoveredElement) {
this.setState({
@@ -6392,9 +6393,18 @@ class App extends React.Component<AppProps, AppState> {
setCursorForShape(this.interactiveCanvas, this.state);
if (lastPoint === lastCommittedPoint) {
const hoveredElement = getHoveredElementForBinding(
pointFrom<GlobalPoint>(scenePointerX, scenePointerY),
this.scene.getNonDeletedElements(),
this.scene.getNonDeletedElementsMap(),
(el) => maxBindingDistance_simple(this.state.zoom),
);
if (
// Finalize arrow if we're inside the commit zone
hoveredElement ||
// if we haven't yet created a temp point and we're beyond commit-zone
// threshold, add a point
if (
pointDistance(
pointFrom(scenePointerX - rx, scenePointerY - ry),
lastPoint,
@@ -6414,7 +6424,6 @@ class App extends React.Component<AppProps, AppState> {
this.state.selectedLinearElement?.initialState,
"initialState must be set",
);
if (this.state.selectedLinearElement.initialState) {
this.setState({
selectedLinearElement: {
...this.state.selectedLinearElement,
@@ -6426,7 +6435,6 @@ class App extends React.Component<AppProps, AppState> {
},
},
});
}
} else {
setCursor(this.interactiveCanvas, CURSOR_TYPE.POINTER);
// in this branch, we're inside the commit zone, and no uncommitted