@visactor/vrender-core
Version:
```typescript import { xxx } from '@visactor/vrender-core'; ```
22 lines (18 loc) • 592 B
JavaScript
import { BaseSymbol } from "./base";
export function square(ctx, r, x, y) {
const wh = 2 * r;
return ctx.rect(x - r, y - r, wh, wh), !1;
}
export class SquareSymbol extends BaseSymbol {
constructor() {
super(...arguments), this.type = "square", this.pathStr = "M-0.5,-0.5h1v1h-1Z";
}
draw(ctx, size, x, y) {
return square(ctx, this.parseSize(size) / 2, x, y);
}
drawOffset(ctx, size, x, y, offset) {
return square(ctx, this.parseSize(size) / 2 + offset, x, y);
}
}
export default new SquareSymbol;
//# sourceMappingURL=square.js.map