UNPKG

mskalign-canvas

Version:

一个用于图片标注的javascript库,基于canvas,简单轻量,支持矩形、多边形、点、折线、圆形。

27 lines (26 loc) 900 B
import Rect from "../shape/Rect"; import Polygon from "../shape/Polygon"; import Dot from "../shape/Dot"; import Line from "../shape/Line"; import Circle from "../shape/Circle"; import Angle from "../shape/Angle"; import Arrow from "../shape/Arrow"; import Ellipse from "../shape/Ellipse"; import CompositeGraph from "../shape/CompositeGraph"; export type Point = [number, number]; export type OffsetPoint = { offsetX: number; offsetY: number; }; export type WH = { w: number; h: number; }; export type HitType = "point" | "baseGraph" | "compositeGraph" | "label" | ""; export type DragAxleType = "x" | "y" | ""; export type RememberPointType = { uuid: string; points: [number, number][]; }; export type RememberPointsType = RememberPointType[]; export type AllShape = Rect | Polygon | Dot | Line | Circle | Angle | Arrow | Ellipse | CompositeGraph;