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,20 +1,20 @@
|
|||
import type { GlobalPoint, LineSegment, Polygon } from "../../math";
|
||||
import type { GlobalPoint, Segment, Polygon } from "../../math";
|
||||
import {
|
||||
point,
|
||||
lineSegment,
|
||||
segment,
|
||||
polygon,
|
||||
pointOnLineSegment,
|
||||
segmentIncludesPoint,
|
||||
pointOnPolygon,
|
||||
polygonIncludesPoint,
|
||||
} from "../../math";
|
||||
|
||||
describe("point and line", () => {
|
||||
const s: LineSegment<GlobalPoint> = lineSegment(point(1, 0), point(1, 2));
|
||||
const s: Segment<GlobalPoint> = segment(point(1, 0), point(1, 2));
|
||||
|
||||
it("point on the line", () => {
|
||||
expect(pointOnLineSegment(point(0, 1), s)).toBe(false);
|
||||
expect(pointOnLineSegment(point(1, 1), s, 0)).toBe(true);
|
||||
expect(pointOnLineSegment(point(2, 1), s)).toBe(false);
|
||||
expect(segmentIncludesPoint(point(0, 1), s)).toBe(false);
|
||||
expect(segmentIncludesPoint(point(1, 1), s, 0)).toBe(true);
|
||||
expect(segmentIncludesPoint(point(2, 1), s)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue