summaryrefslogtreecommitdiffstats
path: root/src/extension/plugins/grid2/grid.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2016-06-01 18:39:05 +0000
committertavmjong-free <tavmjong@free.fr>2016-06-01 18:39:05 +0000
commit61e419a992a054c4417444f6f190a8efbba4bfba (patch)
treeda7ff500a09cdc171d331925e09ef4986a2adf64 /src/extension/plugins/grid2/grid.cpp
parentFix tiling when generic template used to create file. Try 2. (diff)
downloadinkscape-61e419a992a054c4417444f6f190a8efbba4bfba.tar.gz
inkscape-61e419a992a054c4417444f6f190a8efbba4bfba.zip
Replace two instances of getSVGUnit() by getDocumentScale().
Simplify writing of style string. Switch 'pt' to 'px'. (bzr r14938)
Diffstat (limited to '')
-rw-r--r--src/extension/plugins/grid2/grid.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/extension/plugins/grid2/grid.cpp b/src/extension/plugins/grid2/grid.cpp
index 3a2ed7867..6880c574d 100644
--- a/src/extension/plugins/grid2/grid.cpp
+++ b/src/extension/plugins/grid2/grid.cpp
@@ -114,7 +114,8 @@ Grid::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *doc
bounding_area = temprec;
}
- gdouble scale = Inkscape::Util::Quantity::convert(1, "px", &document->doc()->getSVGUnit());
+ double scale = document->doc()->getDocumentScale().inverse()[Geom::X];
+
bounding_area *= Geom::Scale(scale);
Geom::Point spacings( scale * module->get_param_float("xspacing"),
scale * module->get_param_float("yspacing") );
@@ -133,15 +134,9 @@ Grid::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *doc
path->setAttribute("d", path_data.c_str());
- 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];
std::ostringstream stringstream;
- stringstream << line_width;
- sprintf(floatstring, "%s", stringstream.str().c_str());
- style += floatstring;
- style += "pt";
- path->setAttribute("style", style.c_str());
+ stringstream << "fill:none;stroke:#000000;stroke-width:" << line_width << "px";
+ path->setAttribute("style", stringstream.str().c_str());
current_layer->appendChild(path);
Inkscape::GC::release(path);