summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6537e5e)
raw | patch | inline | side by side (parent: 6537e5e)
author | JazzyNico <nicoduf@yahoo.fr> | |
Thu, 27 May 2010 19:41:41 +0000 (21:41 +0200) | ||
committer | JazzyNico <nicoduf@yahoo.fr> | |
Thu, 27 May 2010 19:41:41 +0000 (21:41 +0200) |
src/extension/internal/filter/drop-shadow.h | patch | blob | history | |
src/extension/internal/filter/snow.h | patch | blob | history | |
src/extension/internal/grid.cpp | patch | blob | history |
diff --git a/src/extension/internal/filter/drop-shadow.h b/src/extension/internal/filter/drop-shadow.h
index 34939222c067ac612a60f0623ff4e06aa5e70799..a48175fdeeb488c7e586f982458c958061961443 100644 (file)
{
if (_filter != NULL) g_free((void *)_filter);
- float blur = ext->get_param_float("blur");
- float opacity = ext->get_param_float("opacity") / 100;
- float x = ext->get_param_float("xoffset");
- float y = ext->get_param_float("yoffset");
+ std::ostringstream blur;
+ std::ostringstream opacity;
+ std::ostringstream x;
+ std::ostringstream y;
+
+ blur << ext->get_param_float("blur");
+ opacity << ext->get_param_float("opacity") / 100;
+ x << ext->get_param_float("xoffset");
+ y << ext->get_param_float("yoffset");
_filter = g_strdup_printf(
"<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" inkscape:label=\"Drop shadow\" width=\"1.5\" height=\"1.5\" x=\"-.25\" y=\"-.25\">\n"
- "<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"%f\" result=\"blur\"/>\n"
- "<feColorMatrix result=\"bluralpha\" type=\"matrix\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 %f 0 \" />\n"
- "<feOffset in=\"bluralpha\" dx=\"%f\" dy=\"%f\" result=\"offsetBlur\"/>\n"
+ "<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"%s\" result=\"blur\"/>\n"
+ "<feColorMatrix result=\"bluralpha\" type=\"matrix\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 %s 0 \" />\n"
+ "<feOffset in=\"bluralpha\" dx=\"%s\" dy=\"%s\" result=\"offsetBlur\"/>\n"
"<feMerge>\n"
"<feMergeNode in=\"offsetBlur\"/>\n"
"<feMergeNode in=\"SourceGraphic\"/>\n"
"</feMerge>\n"
- "</filter>\n", blur, opacity, x, y);
+ "</filter>\n", blur.str().c_str(), opacity.str().c_str(), x.str().c_str(), y.str().c_str());
return _filter;
};
{
if (_filter != NULL) g_free((void *)_filter);
- float blur = ext->get_param_float("blur");
- float opacity = ext->get_param_float("opacity") / 100;
- float x = ext->get_param_float("xoffset");
- float y = ext->get_param_float("yoffset");
+ std::ostringstream blur;
+ std::ostringstream opacity;
+ std::ostringstream x;
+ std::ostringstream y;
+
+ blur << ext->get_param_float("blur");
+ opacity << ext->get_param_float("opacity") / 100;
+ x << ext->get_param_float("xoffset");
+ y << ext->get_param_float("yoffset");
_filter = g_strdup_printf(
"<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" inkscape:label=\"Drop shadow\" width=\"1.5\" height=\"1.5\" x=\"-.25\" y=\"-.25\">\n"
- "<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"%f\" result=\"blur\"/>\n"
- "<feColorMatrix result=\"bluralpha\" type=\"matrix\" values=\"-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 %f 0 \" />\n"
- "<feOffset in=\"bluralpha\" dx=\"%f\" dy=\"%f\" result=\"offsetBlur\"/>\n"
+ "<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"%s\" result=\"blur\"/>\n"
+ "<feColorMatrix result=\"bluralpha\" type=\"matrix\" values=\"-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 %s 0 \" />\n"
+ "<feOffset in=\"bluralpha\" dx=\"%s\" dy=\"%s\" result=\"offsetBlur\"/>\n"
"<feMerge>\n"
"<feMergeNode in=\"offsetBlur\"/>\n"
"<feMergeNode in=\"SourceGraphic\"/>\n"
"</feMerge>\n"
- "</filter>\n", blur, opacity, x, y);
+ "</filter>\n", blur.str().c_str(), opacity.str().c_str(), x.str().c_str(), y.str().c_str());
return _filter;
};
index cb5c55f57b26777b7356759df483bdaad710bd83..2bb798cf12e614b5958feebb6c58253aa73540df 100644 (file)
{
if (_filter != NULL) g_free((void *)_filter);
- float drift = ext->get_param_float("drift");
+ std::ostringstream drift;
+ drift << ext->get_param_float("drift");
_filter = g_strdup_printf(
"<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" inkscape:label=\"Snow\">\n"
"<feConvolveMatrix order=\"3 3\" kernelMatrix=\"1 1 1 0 0 0 -1 -1 -1\" preserveAlpha=\"false\" divisor=\"3\"/>\n"
- "<feMorphology operator=\"dilate\" radius=\"1 %f\"/>\n"
+ "<feMorphology operator=\"dilate\" radius=\"1 %s\"/>\n"
"<feGaussianBlur stdDeviation=\"1.6270889487870621\" result=\"result0\"/>\n"
"<feColorMatrix values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0\" result=\"result1\"/>\n"
"<feOffset dx=\"0\" dy=\"1\" result=\"result5\"/>\n"
"<feColorMatrix values=\"0.4 0 0 0 0.6 0 0.4 0 0 0.6 0 0 0 0 1 0 0 0 1 0\" result=\"result4\"/>\n"
"<feComposite in2=\"result5\" in=\"result4\"/>\n"
"<feComposite in2=\"SourceGraphic\"/>\n"
- "</filter>\n", drift);
+ "</filter>\n", drift.str().c_str());
return _filter;
};
index 39bca52d837fcc7b7f7b284bb4950334c8a8d22c..1593ffe795f394881f4cd04719324a1f29344417 100644 (file)
@@ -120,7 +120,9 @@ Grid::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *doc
Glib::ustring style("fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000");
style += ";stroke-width:";
gchar floatstring[64];
- sprintf(floatstring, "%f", line_width);
+ std::ostringstream stringstream;
+ stringstream << line_width;
+ sprintf(floatstring, "%s", stringstream.str().c_str());
style += floatstring;
style += "pt";
path->setAttribute("style", style.c_str());