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,10 +411,13 @@ const bindingStrategyForNewSimpleArrowEndpointDragging = (
const other: BindingStrategy = {
mode: otherIsInsideBinding ? "inside" : "orbit",
element: otherElement,
focusPoint: snapToCenter(
focusPoint: otherIsInsideBinding
? arrowOriginalStartPoint ?? pointFrom<GlobalPoint>(arrow.x, arrow.y)
: snapToCenter(
otherElement,
elementsMap,
arrowOriginalStartPoint ?? pointFrom<GlobalPoint>(arrow.x, arrow.y),
arrowOriginalStartPoint ??
pointFrom<GlobalPoint>(arrow.x, arrow.y),
),
};
@@ -425,7 +428,9 @@ const bindingStrategyForNewSimpleArrowEndpointDragging = (
current = {
mode: isInsideBinding ? "inside" : "orbit",
element: hovered,
focusPoint: snapToCenter(hovered, elementsMap, point),
focusPoint: isInsideBinding
? point
: snapToCenter(hovered, elementsMap, point),
};
} else {
current = { mode: null };