mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fix distance filtering
This commit is contained in:
parent
648728e4b8
commit
85611b8754
1 changed files with 5 additions and 3 deletions
|
@ -264,7 +264,7 @@ const intersectRectanguloidWithLine = (
|
|||
.filter(
|
||||
(p, idx, points) => points.findIndex((d) => pointsEqual(p, d)) === idx,
|
||||
)
|
||||
.sort((g, h) => pointDistanceSq(g!, b) - pointDistanceSq(h!, b))
|
||||
.sort((g, h) => pointDistanceSq(g!, a) - pointDistanceSq(h!, a))
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -390,7 +390,7 @@ const intersectDiamondWithLine = (
|
|||
.filter(
|
||||
(p, idx, points) => points.findIndex((d) => pointsEqual(p, d)) === idx,
|
||||
)
|
||||
.sort((g, h) => pointDistanceSq(g!, b) - pointDistanceSq(h!, b))
|
||||
.sort((g, h) => pointDistanceSq(g!, a) - pointDistanceSq(h!, a))
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -418,5 +418,7 @@ const intersectEllipseWithLine = (
|
|||
return ellipseLineIntersectionPoints(
|
||||
ellipse(center, element.width / 2 + offset, element.height / 2 + offset),
|
||||
line(rotatedA, rotatedB),
|
||||
).map((p) => pointRotateRads(p, center, element.angle));
|
||||
)
|
||||
.map((p) => pointRotateRads(p, center, element.angle))
|
||||
.sort((g, h) => pointDistanceSq(g!, a) - pointDistanceSq(h!, a));
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue