author | Francesco Abbate <francesco.bbt@gmail.com> | 2011年12月07日 10:20:32 +0100 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2011年12月07日 10:20:32 +0100 |
commit | 5d8ac8d479ba20de123ec797abf2d41d1771ab66 (patch) | |
tree | 6607d54f36a5623397378a48fbd63d5e6c6f6626 /agg-plot/draw_svg.cpp | |
parent | 66988c8e83094758e55282c51f45a01933bcc0c9 (diff) | |
download | gsl-shell-5d8ac8d479ba20de123ec797abf2d41d1771ab66.tar.gz |
-rw-r--r-- | agg-plot/draw_svg.cpp | 11 |
diff --git a/agg-plot/draw_svg.cpp b/agg-plot/draw_svg.cpp index a86da5b1..35132771 100644 --- a/agg-plot/draw_svg.cpp +++ b/agg-plot/draw_svg.cpp @@ -49,12 +49,15 @@ str svg_fill_path(str& path_coords, int id, agg::rgba8 c, char rgbstr[8]; format_rgb(rgbstr, c); - double alpha = (double)c.a / 255; - str s = str::print("<path d=\"%s\" " "id=\"path%i\" " - "style=\"fill:%s;fill-opacity:%g;stroke:none\" />", - path_coords.cstr(), id, rgbstr, alpha); + "style=\"fill:%s;stroke:none", + path_coords.cstr(), id, rgbstr); + + if (c.a < 255) { + double alpha = (double)c.a / 255; + s.printf_add(";fill-opacity:%g", alpha); + } append_properties(s, properties); s.append("\" />"); |