UNPKG

@visactor/vrender-core

Version:
30 lines (23 loc) 777 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.SquareSymbol = exports.square = void 0; const base_1 = require("./base"); function square(ctx, r, x, y) { const wh = 2 * r; return ctx.rect(x - r, y - r, wh, wh), !1; } exports.square = square; class SquareSymbol extends base_1.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); } } exports.SquareSymbol = SquareSymbol, exports.default = new SquareSymbol; //# sourceMappingURL=square.js.map