From 61e419a992a054c4417444f6f190a8efbba4bfba Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 1 Jun 2016 20:39:05 +0200 Subject: Replace two instances of getSVGUnit() by getDocumentScale(). Simplify writing of style string. Switch 'pt' to 'px'. (bzr r14938) --- src/extension/internal/grid.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/extension/internal/grid.cpp') diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index 8a9c7a72f..e6938b9e2 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -108,7 +108,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") ); @@ -127,15 +128,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); -- cgit v1.2.3 From 381c20f462265052cd320a26fb779b1d07a7dffc Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 11 Jun 2016 19:25:23 +0200 Subject: Extensions: Use underscored variants of parameters / attribute names in internal extensions where translation via gettext is desired. Fixed bugs: - https://launchpad.net/bugs/1591230 (bzr r14979) --- src/extension/internal/grid.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/extension/internal/grid.cpp') diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index e6938b9e2..c766bd828 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -198,11 +198,11 @@ Grid::init (void) "\n" "" N_("Grid") "\n" "org.inkscape.effect.grid\n" - "1.0\n" - "10.0\n" - "10.0\n" - "0.0\n" - "0.0\n" + "1.0\n" + "10.0\n" + "10.0\n" + "0.0\n" + "0.0\n" "\n" "all\n" "\n" -- cgit v1.2.3 From 1636c1dd1651780d01759676b194312529f211f7 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Sat, 25 Jun 2016 22:24:26 +0200 Subject: Moved next functions, added namespace, renamed range functions (bzr r14954.1.10) --- src/extension/internal/grid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/internal/grid.cpp') diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index c766bd828..fd1b311a8 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -180,7 +180,7 @@ Grid::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View { SPDocument * current_document = view->doc(); - std::vector selected = ((SPDesktop *)view)->getSelection()->itemList(); + std::vector selected = ((SPDesktop *) view)->getSelection()->items(); Inkscape::XML::Node * first_select = NULL; if (!selected.empty()) { first_select = selected[0]->getRepr(); -- cgit v1.2.3