]> gitweb.michael.orlitzky.com - libsvgtiny.git/commitdiff
src/svgtiny.c: set shape opacities from the parser state
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 7 Jun 2025 15:19:49 +0000 (11:19 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 9 Jun 2025 01:13:07 +0000 (21:13 -0400)
Record the "active" fill and stroke opacity from the parser state
in each shape that we create.

src/svgtiny.c

index 361c43b9ecda871035311fc6e96d797541389879..7794c6d141d35ebdf0942abf299073d09aa0c04e 100644 (file)
@@ -1400,6 +1400,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)