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,15 +1,15 @@
|
|||
import { point } from "./point";
|
||||
import { lineSegment, segmentsIntersectAt } from "./segment";
|
||||
import type { GlobalPoint, LineSegment } from "./types";
|
||||
import { segment, segmentsIntersectAt } from "./segment";
|
||||
import type { GlobalPoint, Segment } from "./types";
|
||||
|
||||
describe("segment intersects segment", () => {
|
||||
const lineA: LineSegment<GlobalPoint> = lineSegment(point(1, 4), point(3, 4));
|
||||
const lineB: LineSegment<GlobalPoint> = lineSegment(point(2, 1), point(2, 7));
|
||||
const lineC: LineSegment<GlobalPoint> = lineSegment(point(1, 8), point(3, 8));
|
||||
const lineD: LineSegment<GlobalPoint> = lineSegment(point(1, 8), point(3, 8));
|
||||
const lineE: LineSegment<GlobalPoint> = lineSegment(point(1, 9), point(3, 9));
|
||||
const lineF: LineSegment<GlobalPoint> = lineSegment(point(1, 2), point(3, 4));
|
||||
const lineG: LineSegment<GlobalPoint> = lineSegment(point(0, 1), point(2, 3));
|
||||
const lineA: Segment<GlobalPoint> = segment(point(1, 4), point(3, 4));
|
||||
const lineB: Segment<GlobalPoint> = segment(point(2, 1), point(2, 7));
|
||||
const lineC: Segment<GlobalPoint> = segment(point(1, 8), point(3, 8));
|
||||
const lineD: Segment<GlobalPoint> = segment(point(1, 8), point(3, 8));
|
||||
const lineE: Segment<GlobalPoint> = segment(point(1, 9), point(3, 9));
|
||||
const lineF: Segment<GlobalPoint> = segment(point(1, 2), point(3, 4));
|
||||
const lineG: Segment<GlobalPoint> = segment(point(0, 1), point(2, 3));
|
||||
|
||||
it("intersection", () => {
|
||||
expect(segmentsIntersectAt(lineA, lineB)).toEqual([2, 4]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue