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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user