mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Move utils source into src/
This commit is contained in:
parent
ba0a9e0cb4
commit
4a182f985b
31 changed files with 47 additions and 49 deletions
|
@ -12,13 +12,9 @@ import {
|
|||
|
||||
import type { Curve } from "@excalidraw/math";
|
||||
|
||||
import {
|
||||
pointInEllipse,
|
||||
pointOnEllipse,
|
||||
type GeometricShape,
|
||||
} from "./geometry/shape";
|
||||
import { pointInEllipse, pointOnEllipse, type GeometricShape } from "./shape";
|
||||
|
||||
import type { Polycurve, Polyline } from "./geometry/shape";
|
||||
import type { Polycurve, Polyline } from "./shape";
|
||||
|
||||
// check if the given point is considered on the given shape's border
|
||||
export const isPointOnShape = <Point extends GlobalPoint | LocalPoint>(
|
|
@ -9,9 +9,9 @@ import {
|
|||
|
||||
import type { Curve, Degrees, GlobalPoint } from "@excalidraw/math";
|
||||
|
||||
import { pointOnCurve, pointOnPolyline } from "./collision";
|
||||
import { pointOnCurve, pointOnPolyline } from "../src/collision";
|
||||
|
||||
import type { Polyline } from "./geometry/shape";
|
||||
import type { Polyline } from "../src/shape";
|
||||
|
||||
describe("point and curve", () => {
|
||||
const c: Curve<GlobalPoint> = curve(
|
|
@ -3,7 +3,7 @@ import * as mockedSceneExportUtils from "@excalidraw/excalidraw/scene/export";
|
|||
import { diagramFactory } from "@excalidraw/excalidraw/tests/fixtures/diagramFixture";
|
||||
import { vi } from "vitest";
|
||||
|
||||
import * as utils from ".";
|
||||
import * as utils from "../src";
|
||||
|
||||
const exportToSvgSpy = vi.spyOn(mockedSceneExportUtils, "exportToSvg");
|
||||
|
|
@ -15,7 +15,7 @@ import type {
|
|||
Radians,
|
||||
} from "@excalidraw/math";
|
||||
|
||||
import { pointInEllipse, pointOnEllipse, type Ellipse } from "./shape";
|
||||
import { pointInEllipse, pointOnEllipse, type Ellipse } from "../src/shape";
|
||||
|
||||
describe("point and line", () => {
|
||||
// const l: Line<GlobalPoint> = line(point(1, 0), point(1, 2));
|
|
@ -4,7 +4,7 @@ import { API } from "@excalidraw/excalidraw/tests/helpers/api";
|
|||
|
||||
import type { ImportedDataState } from "@excalidraw/excalidraw/data/types";
|
||||
|
||||
import * as utils from "./index";
|
||||
import * as utils from "../src";
|
||||
|
||||
// NOTE this test file is using the actual API, unmocked. Hence splitting it
|
||||
// from the other test file, because I couldn't figure out how to test
|
|
@ -6,7 +6,7 @@ import {
|
|||
elementPartiallyOverlapsWithOrContainsBBox,
|
||||
elementsOverlappingBBox,
|
||||
isElementInsideBBox,
|
||||
} from "./withinBounds";
|
||||
} from "../src/withinBounds";
|
||||
|
||||
const makeElement = (x: number, y: number, width: number, height: number) =>
|
||||
API.createElement({
|
Loading…
Add table
Add a link
Reference in a new issue