diff options
Diffstat (limited to 'src/svgtiny.c')
-rw-r--r-- | src/svgtiny.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/svgtiny.c b/src/svgtiny.c index abc34ab..be20b20 100644 --- a/src/svgtiny.c +++ b/src/svgtiny.c @@ -1137,8 +1137,10 @@ struct svgtiny_shape *svgtiny_add_shape(struct svgtiny_parse_state *state) shape->text = 0; shape->fill = state->fill; shape->stroke = state->stroke; - shape->stroke_width = state->stroke_width * - (state->ctm.a + state->ctm.d) / 2; + 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) + shape->stroke_width = 1; return shape; } |