summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-11-01 17:39:48 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-11-01 17:39:48 +0000
commite8a542ff4fb18a78bed567eaee7b000581bdd825 (patch)
tree77b968a637d1c036a6ae7f65a062d2619b7df649 /src
parentFixed 32-bit build break. (diff)
downloadinkscape-e8a542ff4fb18a78bed567eaee7b000581bdd825.tar.gz
inkscape-e8a542ff4fb18a78bed567eaee7b000581bdd825.zip
Fix a bug whith units pointed by suv in fillet-chamfer, affecting also to roughen, thanks to Ivan Louette for advert me
(bzr r13651)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-roughen.cpp11
1 files changed, 7 insertions, 4 deletions
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 <gtkmm.h>
-
+#include "desktop.h"
#include "live_effects/lpe-roughen.h"
#include "display/curve.h"
#include "live_effects/parameter/parameter.h"
#include "helper/geom.h"
#include <glibmm/i18n.h>
+#include <util/units.h>
#include <cmath>
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;