From e8a542ff4fb18a78bed567eaee7b000581bdd825 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 1 Nov 2014 18:39:48 +0100 Subject: Fix a bug whith units pointed by suv in fillet-chamfer, affecting also to roughen, thanks to Ivan Louette for advert me (bzr r13651) --- src/live_effects/lpe-roughen.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-roughen.cpp b/src/live_effects/lpe-roughen.cpp index ffd5433bf..ae054fb8a 100644 --- a/src/live_effects/lpe-roughen.cpp +++ b/src/live_effects/lpe-roughen.cpp @@ -14,12 +14,13 @@ */ #include - +#include "desktop.h" #include "live_effects/lpe-roughen.h" #include "display/curve.h" #include "live_effects/parameter/parameter.h" #include "helper/geom.h" #include +#include #include namespace Inkscape { @@ -145,10 +146,11 @@ double LPERoughen::sign(double randNumber) Geom::Point LPERoughen::randomize() { + Inkscape::Util::Unit const *doc_units = inkscape_active_desktop()->namedview->doc_units; double displaceXParsed = Inkscape::Util::Quantity::convert( - displaceX, unit.get_abbreviation(), "px"); + displaceX, unit.get_abbreviation(), doc_units->abbr); double displaceYParsed = Inkscape::Util::Quantity::convert( - displaceY, unit.get_abbreviation(), "px"); + displaceY, unit.get_abbreviation(), doc_units->abbr); Geom::Point output = Geom::Point(sign(displaceXParsed), sign(displaceYParsed)); return output; @@ -159,6 +161,7 @@ void LPERoughen::doEffect(SPCurve *curve) Geom::PathVector const original_pathv = pathv_to_linear_and_cubic_beziers(curve->get_pathvector()); curve->reset(); + Inkscape::Util::Unit const *doc_units = inkscape_active_desktop()->namedview->doc_units; for (Geom::PathVector::const_iterator path_it = original_pathv.begin(); path_it != original_pathv.end(); ++path_it) { if (path_it->empty()) @@ -203,7 +206,7 @@ void LPERoughen::doEffect(SPCurve *curve) nCurve->lineto(A3); } double length = Inkscape::Util::Quantity::convert( - curve_it1->length(0.001), "px", unit.get_abbreviation()); + curve_it1->length(0.001), doc_units->abbr, unit.get_abbreviation()); std::size_t splits = 0; if (method == DM_SEGMENTS) { splits = segments; -- cgit v1.2.3