UNPKG

@visactor/vrender-core

Version:
31 lines (24 loc) 983 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.WedgeSymbol = exports.wedge = void 0; const base_1 = require("./base"); function wedge(ctx, r, transX, transY) { const h = 2 * r; return ctx.moveTo(transX, -r + transY), ctx.lineTo(h / 3 / 2 + transX, r + transY), ctx.lineTo(-h / 3 / 2 + transX, r + transY), ctx.closePath(), !0; } exports.wedge = wedge; class WedgeSymbol extends base_1.BaseSymbol { constructor() { super(...arguments), this.type = "wedge", this.pathStr = "M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"; } draw(ctx, size, transX, transY) { return wedge(ctx, this.parseSize(size) / 2, transX, transY); } drawOffset(ctx, size, transX, transY, offset) { return wedge(ctx, this.parseSize(size) / 2 + offset, transX, transY); } } exports.WedgeSymbol = WedgeSymbol, exports.default = new WedgeSymbol; //# sourceMappingURL=wedge.js.map