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
b2799d0a15
commit
8de0a037fd
1 changed files with 5 additions and 3 deletions
|
@ -923,10 +923,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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue