diff --git a/packages/element/src/binding.ts b/packages/element/src/binding.ts index 555c7e318f..f14ee633cd 100644 --- a/packages/element/src/binding.ts +++ b/packages/element/src/binding.ts @@ -685,10 +685,10 @@ const getBindingStrategyForDraggingBindingElementEndpoints_simple = ( // Handle outside-outside binding to the same element if (otherBinding && otherBinding.elementId === hit?.id) { - const [startFixedPoint, endFixedPoint] = getGlobalFixedPoints( - arrow, - elementsMap, - ); + // const [startFixedPoint, endFixedPoint] = getGlobalFixedPoints( + // arrow, + // elementsMap, + // ); invariant( !opts?.newArrow || appState.selectedLinearElement?.initialState.origin, @@ -704,12 +704,22 @@ const getBindingStrategyForDraggingBindingElementEndpoints_simple = ( : // NOTE: Can only affect the start point because new arrows always drag the end point opts?.newArrow ? appState.selectedLinearElement!.initialState.origin! - : startFixedPoint, + : LinearElementEditor.getPointAtIndexGlobalCoordinates( + arrow, + 0, + elementsMap, + ), // startFixedPoint, }, end: { mode: "inside", element: hit, - focusPoint: endDragged ? globalPoint : endFixedPoint, + focusPoint: endDragged + ? globalPoint + : LinearElementEditor.getPointAtIndexGlobalCoordinates( + arrow, + -1, + elementsMap, + ), // endFixedPoint }, }; } diff --git a/packages/element/src/utils.ts b/packages/element/src/utils.ts index 25086dfd74..f97428a8bc 100644 --- a/packages/element/src/utils.ts +++ b/packages/element/src/utils.ts @@ -1,5 +1,4 @@ import { - debugDrawLine, DEFAULT_ADAPTIVE_RADIUS, DEFAULT_PROPORTIONAL_RADIUS, invariant, @@ -32,9 +31,9 @@ import { elementCenterPoint, getDiamondPoints } from "./bounds"; import { generateLinearCollisionShape } from "./shape"; +import { isPointInElement } from "./collision"; import { LinearElementEditor } from "./linearElementEditor"; import { isRectangularElement } from "./typeChecks"; -import { isPointInElement } from "./collision"; import type { ElementsMap, @@ -599,9 +598,9 @@ export const projectFixedPointOntoDiagonal = ( p = p1 || p2 || null; } - debugDrawLine(diagonalOne, { color: "purple", permanent: true }); - debugDrawLine(diagonalTwo, { color: "purple", permanent: true }); - debugDrawLine(intersector, { color: "orange", permanent: true }); + // debugDrawLine(diagonalOne, { color: "purple", permanent: true }); + // debugDrawLine(diagonalTwo, { color: "purple", permanent: true }); + // debugDrawLine(intersector, { color: "orange", permanent: true }); return p && isPointInElement(p, element, elementsMap) ? p : null; };