]> gitweb.michael.orlitzky.com - libsvgtiny.git/commitdiff
src/svgtiny.c: set shape opacities from the parser state
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 16 Nov 2023 01:39:06 +0000 (20:39 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 20 Nov 2023 16:42:58 +0000 (11:42 -0500)
Record the "active" fill and stroke opacity from the parser state
in each shape that we create.

src/svgtiny.c

index 3ad6eecb192eaa90b84e0c94b4adff9815383064..74ce7eb1775cb92315ac8d7d521ef1533ab2c4a2 100644 (file)
@@ -2447,6 +2447,8 @@ struct svgtiny_shape *svgtiny_add_shape(struct svgtiny_parse_state *state)
        shape->text = 0;
        shape->fill = state->fill;
        shape->stroke = state->stroke;
+       shape->fill_opacity = state->fill_opacity;
+       shape->stroke_opacity = state->stroke_opacity;
        shape->stroke_width = lroundf((float) state->stroke_width *
                        (state->ctm.a + state->ctm.d) / 2.0);
        if (0 < state->stroke_width && shape->stroke_width == 0)