소스 검색

fix: Use the right polygon enclosure test (#9979)

Márk Tolmács 21 시간 전
부모
커밋
ac0d3059dc
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      packages/excalidraw/eraser/index.ts

+ 2 - 2
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;
     }