mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-24 09:50:56 +02:00
fix: Use the right polygon enclosure test (#9979)
This commit is contained in:
@@ -19,7 +19,7 @@ import {
|
|||||||
lineSegmentsDistance,
|
lineSegmentsDistance,
|
||||||
pointFrom,
|
pointFrom,
|
||||||
polygon,
|
polygon,
|
||||||
polygonIncludesPoint,
|
polygonIncludesPointNonZero,
|
||||||
} from "@excalidraw/math";
|
} from "@excalidraw/math";
|
||||||
|
|
||||||
import { getElementsInGroup } from "@excalidraw/element";
|
import { getElementsInGroup } from "@excalidraw/element";
|
||||||
@@ -260,7 +260,7 @@ const eraserTest = (
|
|||||||
// PERF: Check only one point of the eraser segment. If the eraser segment
|
// PERF: Check only one point of the eraser segment. If the eraser segment
|
||||||
// start is inside the closed freedraw shape, the other point is either also
|
// start is inside the closed freedraw shape, the other point is either also
|
||||||
// inside or the eraser segment will intersect the shape outline anyway
|
// inside or the eraser segment will intersect the shape outline anyway
|
||||||
if (polygonIncludesPoint(pathSegment[0], poly)) {
|
if (polygonIncludesPointNonZero(pathSegment[0], poly)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user