Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

fix: Multi-point arrow bound point update (#10831)

Márk Tolmács0b3a5e7cc4d6
diff --git a/packages/element/src/binding.ts b/packages/element/src/binding.ts
index ae84623c3b..bf1eeb63c7 100644
--- a/packages/element/src/binding.ts
+++ b/packages/element/src/binding.ts
@@ -1776,10 +1776,13 @@ export const updateBoundPoint = (
);
const otherArrowPoint = LinearElementEditor.getPointAtIndexGlobalCoordinates(
arrow,
- startOrEnd === "startBinding" ? -1 : 0,
+ startOrEnd === "startBinding" ? 1 : -2,
elementsMap,
);
- const otherFocusPointOrArrowPoint = otherFocusPoint || otherArrowPoint;
+ const otherFocusPointOrArrowPoint =
+ arrow.points.length === 2
+ ? otherFocusPoint || otherArrowPoint
+ : otherArrowPoint;
const intersector =
otherFocusPointOrArrowPoint &&
lineSegment(focusPoint, otherFocusPointOrArrowPoint);