Fix error with fill opacity property in SVG code generation - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/draw_svg.cpp
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2011年12月19日 15:37:18 +0100
committerFrancesco Abbate <francesco.bbt@gmail.com>2011年12月21日 09:26:52 +0100
commitf5fe0e3e413e3776e65d26d6bb1bea042434c0d7 (patch)
tree6df03ace7de11992a005628099af94ce5f4adcb4 /agg-plot/draw_svg.cpp
parent1da3aa43fbcd59da10b5de9e492d1581747ccdc9 (diff)
downloadgsl-shell-f5fe0e3e413e3776e65d26d6bb1bea042434c0d7.tar.gz
Fix error with fill opacity property in SVG code generation
Diffstat (limited to 'agg-plot/draw_svg.cpp')
-rw-r--r--agg-plot/draw_svg.cpp 8
1 files changed, 4 insertions, 4 deletions
diff --git a/agg-plot/draw_svg.cpp b/agg-plot/draw_svg.cpp
index c66e1d68..bc61e876 100644
--- a/agg-plot/draw_svg.cpp
+++ b/agg-plot/draw_svg.cpp
@@ -19,11 +19,11 @@ static void append_properties(str& s, svg_property_list* properties)
}
}
-static void property_append_alpha(str& s, agg::rgba8 c)
+static void property_append_alpha(str& s, const char* prop, agg::rgba8 c)
{
if (c.a < 255) {
double alpha = (double)c.a / 255;
- s.printf_add(";stroke-opacity:%g", alpha);
+ s.printf_add(";%s:%g", prop, alpha);
}
}
@@ -47,7 +47,7 @@ str svg_stroke_path(str& path_coords, double width, int id, agg::rgba8 c,
"stroke-linejoin:miter",
rgbstr, width);
- property_append_alpha(s, c);
+ property_append_alpha(s, "stroke-opacity", c);
append_properties(s, properties);
return gen_path_element(path_coords, s, id);
@@ -66,7 +66,7 @@ str svg_fill_path(str& path_coords, int id, agg::rgba8 c,
char rgbstr[8];
format_rgb(rgbstr, c);
str s = str::print("fill:%s;stroke:none", rgbstr);
- property_append_alpha(s, c);
+ property_append_alpha(s, "fill-opacity", c);
append_properties(s, properties);
return gen_path_element(path_coords, s, id);
}
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月14日 19:00:01 +0000

AltStyle によって変換されたページ (->オリジナル) /