]> gitweb.michael.orlitzky.com - libsvgtiny.git/commitdiff
Round stroke widths to nearest integer instead of down, and force to 1 if it would...
authorJames Bursa <james@netsurf-browser.org>
Sat, 28 Nov 2009 04:08:19 +0000 (04:08 -0000)
committerJames Bursa <james@netsurf-browser.org>
Sat, 28 Nov 2009 04:08:19 +0000 (04:08 -0000)
svn path=/trunk/libsvgtiny/; revision=9707

src/svgtiny.c

index abc34ab3dee0a22b520c1e7997f72aebcffe793a..be20b20abf1201d356291e313297bdf0bf747592 100644 (file)
@@ -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;
 }