From ac0d3059dc71a05d266b0c89715828fa5a2d9532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rk=20Tolm=C3=A1cs?= Date: Mon, 15 Sep 2025 10:07:37 +0200 Subject: [PATCH] fix: Use the right polygon enclosure test (#9979) --- packages/excalidraw/eraser/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/excalidraw/eraser/index.ts b/packages/excalidraw/eraser/index.ts index 567d0a396..8d09b1aaf 100644 --- a/packages/excalidraw/eraser/index.ts +++ b/packages/excalidraw/eraser/index.ts @@ -19,7 +19,7 @@ import { lineSegmentsDistance, pointFrom, polygon, - polygonIncludesPoint, + polygonIncludesPointNonZero, } from "@excalidraw/math"; import { getElementsInGroup } from "@excalidraw/element"; @@ -260,7 +260,7 @@ const eraserTest = ( // 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 // inside or the eraser segment will intersect the shape outline anyway - if (polygonIncludesPoint(pathSegment[0], poly)) { + if (polygonIncludesPointNonZero(pathSegment[0], poly)) { return true; }