@excalidraw/excalidraw 0.17.1-f597bd3 → 0.17.1-f59b4f6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-R7HUEHN5.js → chunk-O74FSJNG.js} +77 -49
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-R7HUEHN5.js.map → chunk-O74FSJNG.js.map} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{image-CAYW6EUH.js → image-F7EVY5ZQ.js} +2 -2
- package/dist/browser/dev/index.js +4 -3
- package/dist/browser/dev/index.js.map +2 -2
- package/dist/browser/prod/excalidraw-assets/chunk-UVJNWDMS.js +55 -0
- package/dist/browser/prod/excalidraw-assets/image-BSC5ABC2.js +1 -0
- package/dist/browser/prod/index.js +4 -4
- package/dist/dev/index.js +78 -47
- package/dist/dev/index.js.map +2 -2
- package/dist/excalidraw/components/App.js +2 -2
- package/dist/excalidraw/data/url.d.ts +1 -0
- package/dist/excalidraw/data/url.js +4 -1
- package/dist/excalidraw/element/embeddable.js +27 -45
- package/dist/excalidraw/element/types.d.ts +3 -0
- package/dist/excalidraw/renderer/staticScene.js +14 -3
- package/dist/excalidraw/renderer/staticSvgScene.js +10 -0
- package/dist/prod/index.js +26 -26
- package/dist/utils/geometry/shape.d.ts +2 -2
- package/dist/utils/geometry/shape.js +8 -2
- package/package.json +1 -1
- package/dist/browser/prod/excalidraw-assets/chunk-6VLWGOPS.js +0 -55
- package/dist/browser/prod/excalidraw-assets/image-2PF7RELG.js +0 -1
- /package/dist/browser/dev/excalidraw-assets-dev/{image-CAYW6EUH.js.map → image-F7EVY5ZQ.js.map} +0 -0
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* also included in this file are methods for converting an Excalidraw element or a Drawable from roughjs
|
|
12
12
|
* to pure shapes
|
|
13
13
|
*/
|
|
14
|
-
import { ExcalidrawDiamondElement, ExcalidrawEllipseElement, ExcalidrawEmbeddableElement, ExcalidrawFrameLikeElement, ExcalidrawFreeDrawElement, ExcalidrawIframeElement, ExcalidrawImageElement, ExcalidrawRectangleElement, ExcalidrawSelectionElement, ExcalidrawTextElement } from "../../excalidraw/element/types";
|
|
14
|
+
import { ExcalidrawDiamondElement, ExcalidrawEllipseElement, ExcalidrawEmbeddableElement, ExcalidrawFrameLikeElement, ExcalidrawFreeDrawElement, ExcalidrawIframeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawRectangleElement, ExcalidrawSelectionElement, ExcalidrawTextElement } from "../../excalidraw/element/types";
|
|
15
15
|
import type { Drawable, Op } from "roughjs/bin/core";
|
|
16
16
|
export type Point = [number, number];
|
|
17
17
|
export type Vector = Point;
|
|
@@ -51,5 +51,5 @@ export declare const getEllipseShape: (element: ExcalidrawEllipseElement) => Geo
|
|
|
51
51
|
export declare const getCurvePathOps: (shape: Drawable) => Op[];
|
|
52
52
|
export declare const getCurveShape: (roughShape: Drawable, startingPoint: Point | undefined, angleInRadian: number, center: Point) => GeometricShape;
|
|
53
53
|
export declare const getFreedrawShape: (element: ExcalidrawFreeDrawElement, center: Point, isClosed?: boolean) => GeometricShape;
|
|
54
|
-
export declare const getClosedCurveShape: (roughShape: Drawable, startingPoint: Point | undefined, angleInRadian: number, center: Point) => GeometricShape;
|
|
54
|
+
export declare const getClosedCurveShape: (element: ExcalidrawLinearElement, roughShape: Drawable, startingPoint: Point | undefined, angleInRadian: number, center: Point) => GeometricShape;
|
|
55
55
|
export {};
|
|
@@ -110,9 +110,15 @@ export const getFreedrawShape = (element, center, isClosed = false) => {
|
|
|
110
110
|
data: polyline,
|
|
111
111
|
};
|
|
112
112
|
};
|
|
113
|
-
export const getClosedCurveShape = (roughShape, startingPoint = [0, 0], angleInRadian, center) => {
|
|
114
|
-
const ops = getCurvePathOps(roughShape);
|
|
113
|
+
export const getClosedCurveShape = (element, roughShape, startingPoint = [0, 0], angleInRadian, center) => {
|
|
115
114
|
const transform = (p) => pointRotate([p[0] + startingPoint[0], p[1] + startingPoint[1]], angleToDegrees(angleInRadian), center);
|
|
115
|
+
if (element.roundness === null) {
|
|
116
|
+
return {
|
|
117
|
+
type: "polygon",
|
|
118
|
+
data: close(element.points.map((p) => transform(p))),
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
const ops = getCurvePathOps(roughShape);
|
|
116
122
|
const points = [];
|
|
117
123
|
let odd = false;
|
|
118
124
|
for (const operation of ops) {
|