fix: Center focus point

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mark Tolmacs
2025-08-20 20:38:51 +02:00
parent 36ca9c41f9
commit 538a773fb8

View File

@@ -411,11 +411,14 @@ const bindingStrategyForNewSimpleArrowEndpointDragging = (
const other: BindingStrategy = { const other: BindingStrategy = {
mode: otherIsInsideBinding ? "inside" : "orbit", mode: otherIsInsideBinding ? "inside" : "orbit",
element: otherElement, element: otherElement,
focusPoint: snapToCenter( focusPoint: otherIsInsideBinding
otherElement, ? arrowOriginalStartPoint ?? pointFrom<GlobalPoint>(arrow.x, arrow.y)
elementsMap, : snapToCenter(
arrowOriginalStartPoint ?? pointFrom<GlobalPoint>(arrow.x, arrow.y), otherElement,
), elementsMap,
arrowOriginalStartPoint ??
pointFrom<GlobalPoint>(arrow.x, arrow.y),
),
}; };
// We are hovering another element with the end point // We are hovering another element with the end point
@@ -425,7 +428,9 @@ const bindingStrategyForNewSimpleArrowEndpointDragging = (
current = { current = {
mode: isInsideBinding ? "inside" : "orbit", mode: isInsideBinding ? "inside" : "orbit",
element: hovered, element: hovered,
focusPoint: snapToCenter(hovered, elementsMap, point), focusPoint: isInsideBinding
? point
: snapToCenter(hovered, elementsMap, point),
}; };
} else { } else {
current = { mode: null }; current = { mode: null };