UNPKG

@visactor/vrender-core

Version:
33 lines (26 loc) 901 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.LineVSymbol = exports.lineV = void 0; const base_1 = require("./base"); function lineV(ctx, r, x, y, z) { return ctx.moveTo(x, y - r), ctx.lineTo(x, y + r), !0; } exports.lineV = lineV; class LineVSymbol extends base_1.BaseSymbol { constructor() { super(...arguments), this.type = "lineV", this.pathStr = "M0,-0.5L0,0.5"; } draw(ctx, size, x, y, z) { return lineV(ctx, this.parseSize(size) / 2, x, y, z); } drawOffset(ctx, size, x, y, offset, z) { return lineV(ctx, this.parseSize(size) / 2 + offset, x, y, z); } drawToSvgPath(size, x, y, z) { const r = this.parseSize(size) / 2; return `M ${x}, ${y - r} L ${x},${y + r}`; } } exports.LineVSymbol = LineVSymbol, exports.default = new LineVSymbol; //# sourceMappingURL=line-v.js.map