fix: Corner jumping & hints (#10403)

* fix: Corner jumping

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>

* fix: Hints

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>

* fix: No corner avoidance for simple arrows

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>

* show alt/cmd hint when creating/moving arrow point any time

---------

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
Márk Tolmács
2025-11-26 12:00:33 +01:00
committed by GitHub
parent c141960ada
commit 019ce4c52c
6 changed files with 34 additions and 29 deletions
+14 -11
View File
@@ -1202,23 +1202,26 @@ export const bindPointToSnapToElementOutline = (
customIntersector?: LineSegment<GlobalPoint>,
): GlobalPoint => {
const elbowed = isElbowArrow(arrowElement);
const point =
customIntersector && !elbowed
? customIntersector[0]
: LinearElementEditor.getPointAtIndexGlobalCoordinates(
arrowElement,
startOrEnd === "start" ? 0 : -1,
elementsMap,
);
const point = LinearElementEditor.getPointAtIndexGlobalCoordinates(
arrowElement,
startOrEnd === "start" ? 0 : -1,
elementsMap,
);
if (arrowElement.points.length < 2) {
// New arrow creation, so no snapping
return point;
}
const edgePoint = isRectanguloidElement(bindableElement)
? avoidRectangularCorner(arrowElement, bindableElement, elementsMap, point)
: point;
const edgePoint =
isRectanguloidElement(bindableElement) && elbowed
? avoidRectangularCorner(
arrowElement,
bindableElement,
elementsMap,
point,
)
: point;
const adjacentPoint =
customIntersector && !elbowed
? customIntersector[1]