Files
AFFiNE-Mirror/blocksuite/affine/gfx/shape/src/overlay/shape.ts
T
2025-03-21 06:13:11 +00:00

28 lines
589 B
TypeScript

import type { Options, RoughCanvas } from '@blocksuite/affine-block-surface';
import type { ShapeStyle } from '@blocksuite/affine-model';
import type { XYWH } from '@blocksuite/global/gfx';
export abstract class Shape {
options: Options;
shapeStyle: ShapeStyle;
type: string;
xywh: XYWH;
constructor(
xywh: XYWH,
type: string,
options: Options,
shapeStyle: ShapeStyle
) {
this.xywh = xywh;
this.type = type;
this.options = options;
this.shapeStyle = shapeStyle;
}
abstract draw(ctx: CanvasRenderingContext2D, rc: RoughCanvas): void;
}