mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fixing math package
This commit is contained in:
parent
44d8a6b4fe
commit
5e68895709
26 changed files with 37 additions and 37 deletions
|
@ -17,10 +17,10 @@ import type {
|
|||
Radians,
|
||||
} from "@excalidraw/math";
|
||||
|
||||
import { rescalePoints } from "../points";
|
||||
import { generateRoughOptions } from "../scene/Shape";
|
||||
import { ShapeCache } from "../scene/ShapeCache";
|
||||
import { arrayToMap, invariant } from "../utils";
|
||||
import { rescalePoints } from "@excalidraw/excalidraw/points";
|
||||
import { generateRoughOptions } from "@excalidraw/excalidraw/scene/Shape";
|
||||
import { ShapeCache } from "@excalidraw/excalidraw/scene/ShapeCache";
|
||||
import { arrayToMap, invariant } from "@excalidraw/excalidraw/utils";
|
||||
|
||||
import { LinearElementEditor } from "./linearElementEditor";
|
||||
import { getBoundTextElement, getContainerElement } from "./textElement";
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
export * from "./angle";
|
||||
export * from "./curve";
|
||||
export * from "./line";
|
||||
export * from "./point";
|
||||
export * from "./polygon";
|
||||
export * from "./range";
|
||||
export * from "./rectangle";
|
||||
export * from "./segment";
|
||||
export * from "./triangle";
|
||||
export * from "./types";
|
||||
export * from "./vector";
|
||||
export * from "./utils";
|
||||
export * from "./src/angle";
|
||||
export * from "./src/curve";
|
||||
export * from "./src/line";
|
||||
export * from "./src/point";
|
||||
export * from "./src/polygon";
|
||||
export * from "./src/range";
|
||||
export * from "./src/rectangle";
|
||||
export * from "./src/segment";
|
||||
export * from "./src/triangle";
|
||||
export * from "./src/types";
|
||||
export * from "./src/vector";
|
||||
export * from "./src/utils";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { toBrandedType } from "@excalidraw/common/utils";
|
||||
import { toBrandedType } from "@excalidraw/common";
|
||||
|
||||
import type { InclusiveRange } from "./types";
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
import "../utils/test-utils";
|
||||
import "../../utils/test-utils";
|
||||
|
||||
import {
|
||||
curve,
|
||||
curveClosestPoint,
|
||||
curveIntersectLineSegment,
|
||||
curvePointDistance,
|
||||
} from "./curve";
|
||||
import { pointFrom } from "./point";
|
||||
import { lineSegment } from "./segment";
|
||||
} from "../src/curve";
|
||||
import { pointFrom } from "../src/point";
|
||||
import { lineSegment } from "../src/segment";
|
||||
|
||||
describe("Math curve", () => {
|
||||
describe("line segment intersection", () => {
|
|
@ -4,12 +4,12 @@ import {
|
|||
ellipseIncludesPoint,
|
||||
ellipseTouchesPoint,
|
||||
ellipseLineIntersectionPoints,
|
||||
} from "./ellipse";
|
||||
import { line } from "./line";
|
||||
import { pointFrom } from "./point";
|
||||
import { lineSegment } from "./segment";
|
||||
} from "../src/ellipse";
|
||||
import { line } from "../src/line";
|
||||
import { pointFrom } from "../src/point";
|
||||
import { lineSegment } from "../src/segment";
|
||||
|
||||
import type { Ellipse, GlobalPoint } from "./types";
|
||||
import type { Ellipse, GlobalPoint } from "../src/types";
|
||||
|
||||
describe("point and ellipse", () => {
|
||||
it("point on ellipse", () => {
|
|
@ -1,5 +1,5 @@
|
|||
import { line, linesIntersectAt } from "./line";
|
||||
import { pointFrom } from "./point";
|
||||
import { line, linesIntersectAt } from "../src/line";
|
||||
import { pointFrom } from "../src/point";
|
||||
|
||||
describe("line-line intersections", () => {
|
||||
it("should correctly detect intersection at origin", () => {
|
|
@ -1,6 +1,6 @@
|
|||
import { pointFrom, pointRotateRads } from "./point";
|
||||
import { pointFrom, pointRotateRads } from "../src/point";
|
||||
|
||||
import type { Radians } from "./types";
|
||||
import type { Radians } from "../src/types";
|
||||
|
||||
describe("rotate", () => {
|
||||
it("should rotate over (x2, y2) and return the rotated coordinates for (x1, y1)", () => {
|
|
@ -1,4 +1,4 @@
|
|||
import { rangeInclusive, rangeIntersection, rangesOverlap } from "./range";
|
||||
import { rangeInclusive, rangeIntersection, rangesOverlap } from "../src/range";
|
||||
|
||||
describe("range overlap", () => {
|
||||
const range1_4 = rangeInclusive(1, 4);
|
|
@ -1,5 +1,5 @@
|
|||
import { pointFrom } from "./point";
|
||||
import { lineSegment, lineSegmentIntersectionPoints } from "./segment";
|
||||
import { pointFrom } from "../src/point";
|
||||
import { lineSegment, lineSegmentIntersectionPoints } from "../src/segment";
|
||||
|
||||
describe("line-segment intersections", () => {
|
||||
it("should correctly detect intersection", () => {
|
|
@ -1,4 +1,4 @@
|
|||
import { isVector } from ".";
|
||||
import { isVector } from "../src/vector";
|
||||
|
||||
describe("Vector", () => {
|
||||
test("isVector", () => {
|
|
@ -19,7 +19,7 @@
|
|||
"@excalidraw/excalidraw": ["./excalidraw/index.tsx"],
|
||||
"@excalidraw/excalidraw/*": ["./excalidraw/*"],
|
||||
"@excalidraw/math": ["./math/index.ts"],
|
||||
"@excalidraw/math/*": ["./math/*"],
|
||||
"@excalidraw/math/*": ["./math/src/*"],
|
||||
"@excalidraw/utils": ["./utils/index.ts"],
|
||||
"@excalidraw/utils/*": ["./utils/*"],
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ const getConfig = (outdir) => ({
|
|||
entryNames: "[name]",
|
||||
assetNames: "[dir]/[name]",
|
||||
alias: {
|
||||
"@excalidraw/common": path.resolve(__dirname, "../packages/common/src"),
|
||||
"@excalidraw/common": path.resolve(__dirname, "../packages/common"),
|
||||
"@excalidraw/element": path.resolve(__dirname, "../packages/element"),
|
||||
"@excalidraw/excalidraw": path.resolve(__dirname, "../packages/excalidraw"),
|
||||
"@excalidraw/utils": path.resolve(__dirname, "../packages/utils"),
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"@excalidraw/element": ["./packages/element/index.ts"],
|
||||
"@excalidraw/element/*": ["./packages/element/*"],
|
||||
"@excalidraw/math": ["./packages/math/index.ts"],
|
||||
"@excalidraw/math/*": ["./packages/math/*"],
|
||||
"@excalidraw/math/*": ["./packages/math/src/*"],
|
||||
"@excalidraw/utils": ["./packages/utils/index.ts"],
|
||||
"@excalidraw/utils/*": ["./packages/utils/*"],
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue