mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-19 23:40:45 +02:00
Linear element compatible snap binding
This commit is contained in:
@@ -924,10 +924,12 @@ export const bindPointToSnapToElementOutline = (
|
|||||||
|
|
||||||
const aabb = aabbForElement(bindableElement);
|
const aabb = aabbForElement(bindableElement);
|
||||||
const localP =
|
const localP =
|
||||||
arrow.points[startOrEnd === "start" ? 0 : arrow.points.length - 1];
|
linearElement.points[
|
||||||
|
startOrEnd === "start" ? 0 : linearElement.points.length - 1
|
||||||
|
];
|
||||||
const globalP = pointFrom<GlobalPoint>(
|
const globalP = pointFrom<GlobalPoint>(
|
||||||
arrow.x + localP[0],
|
linearElement.x + localP[0],
|
||||||
arrow.y + localP[1],
|
linearElement.y + localP[1],
|
||||||
);
|
);
|
||||||
const edgePoint = isRectanguloidElement(bindableElement)
|
const edgePoint = isRectanguloidElement(bindableElement)
|
||||||
? avoidRectangularCorner(bindableElement, globalP)
|
? avoidRectangularCorner(bindableElement, globalP)
|
||||||
|
Reference in New Issue
Block a user