@yorab/react-paint 0.13.0 → 0.13.1

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.
@@ -11,10 +11,13 @@ export declare const getCursorPositionInTransformedCanvas: (e: MouseEvent | Touc
11
11
  export declare const isTouchGesture: (e: MouseEvent | TouchEvent) => e is TouchEvent;
12
12
  export declare const getPointPositionAfterCanvasTransformation: (point: Point, shapeRotation: number, [originX, originY]: Point) => Point;
13
13
  export declare const getPointPositionBeforeCanvasTransformation: (point: Point, shapeRotation: number, [originX, originY]: Point) => Point;
14
- export declare const checkSelectionIntersection: (shape: DrawableShape, position: Point, settings: UtilsSettings, checkAnchors?: boolean, radius?: number) => false | HoverModeData;
14
+ export declare const checkSelectionIntersection: (ctx: CanvasRenderingContext2D, shape: DrawableShape, position: Point, settings: UtilsSettings, checkAnchors?: boolean, radius?: number) => false | HoverModeData;
15
15
  export declare const checkPolygonLinesSelectionIntersection: (ctx: CanvasRenderingContext2D, shape: DrawableShape<"polygon" | "curve">, position: Point, settings: UtilsSettings, radius?: number) => false | {
16
16
  lineIndex: number;
17
17
  };
18
+ export declare const checkCurveLinesSelectionIntersection: (ctx: CanvasRenderingContext2D, shape: DrawableShape<"curve">, position: Point, settings: UtilsSettings, radius?: number) => false | {
19
+ lineIndex: number;
20
+ };
18
21
  export declare const checkPositionIntersection: (ctx: CanvasRenderingContext2D, shape: DrawableShape, position: Point, settings: UtilsSettings) => false | HoverModeData;
19
22
  export declare function getRectIntersection(rect1: Rect, rect2: Rect): Rect | undefined;
20
23
  export declare const checkSelectionFrameCollision: (ctx: CanvasRenderingContext2D, shape: DrawableShape, selectionFrame: [Point, Point], settings: UtilsSettings) => boolean;
@@ -14,5 +14,5 @@ export declare const getCurveBorder: (polygon: import("./../../../common/types/S
14
14
  export declare const translateCurve: <U extends DrawableShape<"curve">>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point, settings: UtilsSettings, singleAxis: boolean) => U & {
15
15
  points: [number, number][];
16
16
  };
17
- export declare const addCurveLine: <T extends DrawableShape<"curve">>(shape: T, lineIndex: number, settings: UtilsSettings) => T;
17
+ export declare const addCurveLine: <T extends DrawableShape<"curve">>(shape: T, lineIndex: number, cursorPosition: Point, settings: UtilsSettings) => T;
18
18
  export declare const addCurvePoint: <T extends DrawableShape<"curve">>(shape: T, cursorPosition: Point, settings: UtilsSettings, temporary?: boolean) => T;
@@ -1,10 +1,12 @@
1
1
  import type { UtilsSettings } from './../../../canvas/constants/app';
2
- import type { Circle, DrawableShape, Line, Rect } from './../../../common/types/Shapes';
2
+ import type { Circle, DrawableShape, Line, Point, Rect } from './../../../common/types/Shapes';
3
3
  export declare const createRecPath: (rect: Rect) => Path2D;
4
4
  export declare const createCirclePath: (shape: Circle) => Path2D;
5
5
  export declare const createEllipsePath: (ellipse: DrawableShape<"ellipse">) => Path2D;
6
6
  export declare const createLinePath: (line: Line) => Path2D;
7
7
  export declare const createBrushPath: (brush: DrawableShape<"brush">, { brushAlgo }: UtilsSettings) => Path2D | undefined;
8
+ export declare const getCatmullRomPoints: (curve: DrawableShape<"curve">, points: Point[]) => [number, number][];
9
+ export declare const catmullRomToBezier: (path: Path2D, p0: Point, p1: Point, p2: Point, p3: Point) => void;
8
10
  export declare const createCurvePath: (curve: DrawableShape<"curve">) => Path2D | undefined;
9
11
  export declare const createPolygonPath: (polygon: DrawableShape<"polygon"> | DrawableShape<"curve">) => Path2D | undefined;
10
12
  export declare const createTrianglePath: (triangle: DrawableShape<"triangle">) => Path2D;
@@ -14,5 +14,5 @@ export declare const translatePolygon: <U extends DrawableShape<"polygon">>(curs
14
14
  points: [number, number][];
15
15
  };
16
16
  export declare const resizePolygon: (cursorPosition: Point, originalShape: DrawableShape<"polygon">, selectionMode: SelectionModeResize<number>, settings: UtilsSettings) => DrawableShape<"polygon">;
17
- export declare const addPolygonLine: <T extends DrawableShape<"polygon">>(shape: T, lineIndex: number, settings: UtilsSettings) => T;
17
+ export declare const addPolygonLine: <T extends DrawableShape<"polygon">>(shape: T, lineIndex: number, cursorPosition: Point, settings: UtilsSettings) => T;
18
18
  export declare const addPolygonPoint: <T extends DrawableShape<"polygon">>(shape: T, cursorPosition: Point, settings: UtilsSettings, temporary?: boolean) => T;
@@ -17,7 +17,6 @@ export type SelectionModeEditText = {
17
17
  };
18
18
  export type SelectionModeResize<AnchorType extends Point | number = Point> = {
19
19
  mode: 'resize';
20
- isCreating: boolean;
21
20
  cursorStartPosition: Point;
22
21
  originalShape: ShapeEntity;
23
22
  anchor: AnchorType;