Skip to content

Commit

Permalink
feat(hdom-canvas): add defs node/group type
Browse files Browse the repository at this point in the history
- in preparation for easier conversion to SVG-hiccup
  • Loading branch information
postspectacular committed Sep 14, 2018
1 parent 75002fa commit de61c21
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/hdom-canvas/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ const walk = (ctx: CanvasRenderingContext2D, shape: any[], pstate: DrawState) =>
const attribs = state ? state.attribs : pstate.attribs;
switch (shape[0]) {
case "g":
for (let i = 2, n = shape.length, __state = state || pstate; i < n; i++) {
case "defs":
for (let i = 2, n = shape.length,
__state = shape[0] === "g" ? state || pstate : pstate;
i < n; i++) {
walk(ctx, shape[i], __state);
}
break;
Expand Down

0 comments on commit de61c21

Please sign in to comment.