mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
More refactor
This commit is contained in:
parent
392dd5b0b8
commit
b697f63cad
18 changed files with 206 additions and 199 deletions
|
@ -1,5 +1,5 @@
|
|||
import { pointsEqual } from "./point";
|
||||
import { lineSegment, pointOnLineSegment } from "./segment";
|
||||
import { segment, segmentIncludesPoint } from "./segment";
|
||||
import type { GenericPoint, Polygon } from "./types";
|
||||
import { PRECISION } from "./utils";
|
||||
|
||||
|
@ -44,7 +44,7 @@ export const pointOnPolygon = <Point extends GenericPoint>(
|
|||
let on = false;
|
||||
|
||||
for (let i = 0, l = poly.length - 1; i < l; i++) {
|
||||
if (pointOnLineSegment(p, lineSegment(poly[i], poly[i + 1]), threshold)) {
|
||||
if (segmentIncludesPoint(p, segment(poly[i], poly[i + 1]), threshold)) {
|
||||
on = true;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue