summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2008-02-03 21:50:32 (GMT)
committer James Bursa <james@netsurf-browser.org>2008-02-03 21:50:32 (GMT)
commit307db5bbbc3b9c143aa99f61289dd39e65583c23 (patch)
treec9f4be540723c4c64155701cebdaf8ac407add50
parent6cf39ca675e80d5207c635394a0edc7b33ea9642 (diff)
downloadlibsvgtiny-307db5bbbc3b9c143aa99f61289dd39e65583c23.tar.gz
libsvgtiny-307db5bbbc3b9c143aa99f61289dd39e65583c23.tar.bz2
Scale stroke-width correctly.
svn path=/trunk/libsvgtiny/; revision=3841
-rw-r--r--svgtiny.c3
-rw-r--r--svgtiny_test.c1
2 files changed, 3 insertions, 1 deletions
diff --git a/svgtiny.c b/svgtiny.c
index ad2e8a5..2847af4 100644
--- a/svgtiny.c
+++ b/svgtiny.c
@@ -1033,7 +1033,8 @@ 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;
+ shape->stroke_width = state->stroke_width *
+ (state->ctm.a + state->ctm.d) / 2;
return shape;
}
diff --git a/svgtiny_test.c b/svgtiny_test.c
index 8d485d3..34149b9 100644
--- a/svgtiny_test.c
+++ b/svgtiny_test.c
@@ -80,6 +80,7 @@ int main(int argc, char *argv[])
printf("stroke none ");
else
printf("stroke #%.6x ", diagram->shape[i].stroke);
+ printf("stroke-width %i ", diagram->shape[i].stroke_width);
if (diagram->shape[i].path) {
printf("path '");
for (unsigned int j = 0;