Skip to content

Commit

Permalink
feat(hiccup-canvas): add fillRule attrib support
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jun 19, 2024
1 parent 56992b2 commit 9acb563
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/hiccup-canvas/src/internal/end-shape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const __endShape = (
) => {
let v: any;
if (doFill && (v = attribs.fill) && v !== "none") {
ctx.fill();
(v = attribs.fillRule) ? ctx.fill(v) : ctx.fill();
}
if ((v = attribs.stroke) && v !== "none") {
ctx.stroke();
Expand Down
2 changes: 2 additions & 0 deletions packages/hiccup-canvas/src/internal/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const CTX_ATTRIBS: IObjectOf<string> = {
dashOffset: "lineDashOffset",
direction: "direction",
fill: "fillStyle",
fillRule: "fillRule",
filter: "filter",
font: "font",
lineCap: "lineCap",
Expand Down Expand Up @@ -148,6 +149,7 @@ const __setAttrib = (
(<any>ctx)[k].call(ctx, val);
break;
case "clip":
case "fillRule":
break;
default:
(<any>ctx)[k] = val;
Expand Down

0 comments on commit 9acb563

Please sign in to comment.