@visactor/vrender-core
Version:
## Description
29 lines (22 loc) • 820 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.StrokeSymbol = exports.stroke = void 0;
const base_1 = require("./base");
function stroke(ctx, r, transX, transY) {
return ctx.moveTo(-r + transX, transY), ctx.lineTo(transX, r + transY), !1;
}
exports.stroke = stroke;
class StrokeSymbol extends base_1.BaseSymbol {
constructor() {
super(...arguments), this.type = "stroke", this.pathStr = "";
}
draw(ctx, size, transX, transY) {
return stroke(ctx, this.parseSize(size) / 2, transX, transY);
}
drawOffset(ctx, size, transX, transY, offset) {
return stroke(ctx, this.parseSize(size) / 2 + offset, transX, transY);
}
}
exports.StrokeSymbol = StrokeSymbol, exports.default = new StrokeSymbol;
//# sourceMappingURL=stroke.js.map