UNPKG

@gorpacrate/core-graphics

Version:

A core library for creating shape-based graphic editors

77 lines (76 loc) 2.01 kB
export { multiply, flip, IMatrix3, ICol3 } from 'matrix-utilities'; import { ICol3, IMatrix3 } from 'matrix-utilities'; import { IBoundingBox, IGraphicalContextData, IPoint, IShapeData, IShapeResizeHandle } from '../declarations'; export { IGraphicalContextData }; export declare const getCol3FromPoint: (x: number, y: number) => ICol3; export declare const getTranslateMatrix: (dx: number, dy: number) => IMatrix3; export declare const getScaleMatrix: (kx: number, ky: number) => IMatrix3; export declare function getResizeOrigin(params: { handle: IShapeResizeHandle; bb: IBoundingBox; }): IPoint; export declare function getResizeCoeffs(params: { pOrigin: IPoint; pStart: IPoint; pEnd: IPoint; proportional: boolean; minWidth: number; minHeight: number; }): { kx: number; ky: number; }; export declare function transformShapeKeyPoints(transformMatrix: IMatrix3, data: IShapeData): { keyPoints: ({ x: number; y: number; payload: any; } | { x: number; y: number; payload?: undefined; })[]; id: string; type: string; customParams?: any; graphicalContextData: IGraphicalContextData; }; export declare function moveShapeKeyPoints(delta: { dx: number; dy: number; }, data: IShapeData): { keyPoints: ({ x: number; y: number; payload: any; } | { x: number; y: number; payload?: undefined; })[]; id: string; type: string; customParams?: any; graphicalContextData: IGraphicalContextData; }; export declare function scaleShapeKeyPoints(origin: { oX: number; oY: number; }, scale: { kx: number; ky: number; }, data: IShapeData): { keyPoints: ({ x: number; y: number; payload: any; } | { x: number; y: number; payload?: undefined; })[]; id: string; type: string; customParams?: any; graphicalContextData: IGraphicalContextData; };