UNPKG

1.13 kBTypeScriptView Raw
1import { IElement, IGroup, IShape } from '../dependents';
2declare const transform: (m: number[], actions: any[][]) => number[];
3export { transform };
4/**
5 * 对元素进行平移操作。
6 * @param element 进行变换的元素
7 * @param x x 方向位移
8 * @param y y 方向位移
9 */
10export declare function translate(element: IGroup | IShape, x: number, y: number): void;
11/**
12 * 获取元素旋转矩阵 (以元素的左上角为旋转点)
13 * @param element 进行变换的元素
14 * @param rotateRadian 旋转弧度
15 */
16export declare function getRotateMatrix(element: IElement, rotateRadian: number): number[];
17/**
18 * 对元素进行旋转操作。
19 * @param element 进行变换的元素
20 * @param rotateRadian 旋转弧度
21 */
22export declare function rotate(element: IGroup | IShape, rotateRadian: number): void;
23/**
24 * 获取元矩阵。
25 * @returns identity matrix
26 */
27export declare function getIdentityMatrix(): number[];
28/**
29 * 围绕图形中心点进行缩放
30 * @param element 进行缩放的图形元素
31 * @param ratio 缩放比例
32 */
33export declare function zoom(element: IGroup | IShape, ratio: number): void;