mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-17 08:47:16 -04:00
Different approach to inside binding
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
c229e7a42a
commit
ac5612db2a
@ -409,7 +409,8 @@ const bindingStrategyForNewSimpleArrowEndpointDragging = (
|
||||
otherElement.x + otherElement.width / 2,
|
||||
otherElement.y + otherElement.height / 2,
|
||||
);
|
||||
const otherIsInsideBinding = arrow.startBinding?.mode === "inside";
|
||||
const otherIsInsideBinding =
|
||||
!!appState.selectedLinearElement?.pointerDownState.arrowStartIsInside;
|
||||
|
||||
// We need to "jump" the start point out with the detached
|
||||
// focus point of the center of the bound element
|
||||
|
@ -143,6 +143,7 @@ export class LinearElementEditor {
|
||||
added: boolean;
|
||||
};
|
||||
arrowOriginalStartPoint?: GlobalPoint;
|
||||
arrowStartIsInside: boolean;
|
||||
}>;
|
||||
|
||||
/** whether you're dragging a point */
|
||||
@ -186,6 +187,7 @@ export class LinearElementEditor {
|
||||
index: null,
|
||||
added: false,
|
||||
},
|
||||
arrowStartIsInside: false,
|
||||
};
|
||||
this.hoverPointIndex = -1;
|
||||
this.segmentMidPointHoveredCoords = null;
|
||||
@ -582,6 +584,7 @@ export class LinearElementEditor {
|
||||
pointerDownState: {
|
||||
...editingLinearElement.pointerDownState,
|
||||
arrowOriginalStartPoint: undefined,
|
||||
arrowStartIsInside: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
@ -889,6 +892,9 @@ export class LinearElementEditor {
|
||||
index: segmentMidpointIndex,
|
||||
added: false,
|
||||
},
|
||||
arrowStartIsInside:
|
||||
!!app.state.newElement &&
|
||||
(app.state.bindMode === "inside" || app.state.bindMode === "skip"),
|
||||
},
|
||||
selectedPointsIndices: [element.points.length - 1],
|
||||
lastUncommittedPoint: null,
|
||||
@ -948,6 +954,9 @@ export class LinearElementEditor {
|
||||
index: segmentMidpointIndex,
|
||||
added: false,
|
||||
},
|
||||
arrowStartIsInside:
|
||||
!!app.state.newElement &&
|
||||
(app.state.bindMode === "inside" || app.state.bindMode === "skip"),
|
||||
},
|
||||
selectedPointsIndices: nextSelectedPointsIndices,
|
||||
pointerOffset: targetPoint
|
||||
|
Loading…
x
Reference in New Issue
Block a user