@visactor/vrender-core
Version:
## Description
21 lines (17 loc) • 635 B
JavaScript
import { BaseSymbol } from "./base";
export function stroke(ctx, r, transX, transY) {
return ctx.moveTo(-r + transX, transY), ctx.lineTo(transX, r + transY), !1;
}
export class StrokeSymbol extends 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);
}
}
export default new StrokeSymbol;
//# sourceMappingURL=stroke.js.map