fix: Sort was incorrectly called

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mark Tolmacs 2025-05-22 13:57:01 +02:00
parent 9c04e22897
commit 5081abdde1
No known key found for this signature in database

View File

@ -8,6 +8,7 @@ import {
isPointWithinBounds, isPointWithinBounds,
lineSegment, lineSegment,
lineSegmentIntersectionPoints, lineSegmentIntersectionPoints,
pointDistanceSq,
pointFrom, pointFrom,
pointFromVector, pointFromVector,
pointRotateRads, pointRotateRads,
@ -217,7 +218,7 @@ const intersectLinearOrFreeDrawWithLineSegment = (
.map((l) => lineSegmentIntersectionPoints(l, segment)) .map((l) => lineSegmentIntersectionPoints(l, segment))
.filter((p): p is GlobalPoint => p != null), .filter((p): p is GlobalPoint => p != null),
...curves.flatMap((c) => curveIntersectLineSegment(c, segment)), ...curves.flatMap((c) => curveIntersectLineSegment(c, segment)),
].sort(); ].sort(pointDistanceSq);
}; };
const intersectRectanguloidWithLineSegment = ( const intersectRectanguloidWithLineSegment = (