Set the current state's affine in the generic function

parent 7fd11755
......@@ -183,7 +183,6 @@ impl NodeTrait for NodeSvg {
draw_ctx,
|affine| {
drawing_ctx::state_push(draw_ctx);
drawing_ctx::set_current_state_affine(draw_ctx, affine);
node.draw_children(draw_ctx, -1); // dominate==-1 so it won't reinherit or push a layer
drawing_ctx::state_pop(draw_ctx);
});
......
......@@ -21,7 +21,7 @@ pub fn draw_in_viewport<F>(vx: f64, vy: f64, vw: f64, vh: f64,
// https://www.w3.org/TR/SVG/struct.html#UseElementWidthAttribute
// https://www.w3.org/TR/SVG/struct.html#ImageElementWidthAttribute
// https://www.w3.org/TR/SVG/painting.html#MarkerWidthAttribute
if double_equals(vw, 0.0) || double_equals(vh, 0.0) {
return;
}
......@@ -52,9 +52,10 @@ pub fn draw_in_viewport<F>(vx: f64, vy: f64, vw: f64, vh: f64,
drawing_ctx::add_clipping_rect(draw_ctx, vx, vy, vw, vh);
}
drawing_ctx::set_current_state_affine(draw_ctx, affine);
draw_fn(affine);
drawing_ctx::pop_discrete_layer(draw_ctx);
drawing_ctx::pop_view_box(draw_ctx);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment