mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Linear element compatible snap binding
This commit is contained in:
parent
03b91deb4a
commit
f354285d69
1 changed files with 5 additions and 3 deletions
|
@ -924,10 +924,12 @@ export const bindPointToSnapToElementOutline = (
|
|||
|
||||
const aabb = aabbForElement(bindableElement);
|
||||
const localP =
|
||||
arrow.points[startOrEnd === "start" ? 0 : arrow.points.length - 1];
|
||||
linearElement.points[
|
||||
startOrEnd === "start" ? 0 : linearElement.points.length - 1
|
||||
];
|
||||
const globalP = pointFrom<GlobalPoint>(
|
||||
arrow.x + localP[0],
|
||||
arrow.y + localP[1],
|
||||
linearElement.x + localP[0],
|
||||
linearElement.y + localP[1],
|
||||
);
|
||||
const edgePoint = isRectanguloidElement(bindableElement)
|
||||
? avoidRectangularCorner(bindableElement, globalP)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue