@thi.ng/hiccup-canvas
Version:
Hiccup shape tree renderer for vanilla Canvas 2D contexts
17 lines (16 loc) • 476 B
JavaScript
import { __endShape } from "./internal/end-shape.js";
import { __drawPackedPoly, __drawPoly } from "./polygon.js";
const polyline = (ctx, attribs, pts) => {
if (pts.length < 2 || attribs.stroke == "none") return;
__drawPoly(ctx, pts);
__endShape(ctx, attribs, false);
};
const packedPolyline = (ctx, attribs, opts, pts) => {
if (pts.length < 2) return;
__drawPackedPoly(ctx, opts, pts);
__endShape(ctx, attribs, false);
};
export {
packedPolyline,
polyline
};