diff options
| author | Martin Owens <doctormo@gmail.com> | 2014-03-27 01:33:44 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2014-03-27 01:33:44 +0000 |
| commit | 5a4fb2325f60d292b47330f540b26a3279341c90 (patch) | |
| tree | d2aa7967be25450b83e625025366c618101ae49f /src/live_effects/lpe-path_length.cpp | |
| parent | The Polar Arrange Tab of the Arrange Dialog now hides the parametric (diff) | |
| parent | Remove Snap menu item and improve grid menu item text (diff) | |
| download | inkscape-5a4fb2325f60d292b47330f540b26a3279341c90.tar.gz inkscape-5a4fb2325f60d292b47330f540b26a3279341c90.zip | |
Commit a merge to trunk, with probabal errors
(bzr r11073.1.36)
Diffstat (limited to 'src/live_effects/lpe-path_length.cpp')
| -rw-r--r-- | src/live_effects/lpe-path_length.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/live_effects/lpe-path_length.cpp b/src/live_effects/lpe-path_length.cpp index e33a16002..4ca380c15 100644 --- a/src/live_effects/lpe-path_length.cpp +++ b/src/live_effects/lpe-path_length.cpp @@ -1,4 +1,3 @@ -#define INKSCAPE_LPE_PATH_LENGTH_CPP /** \file * LPE <path_length> implementation. */ @@ -12,8 +11,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include <glibmm/i18n.h> + #include "live_effects/lpe-path_length.h" -#include "sp-metrics.h" +#include "util/units.h" #include "2geom/sbasis-geometric.h" @@ -22,9 +23,9 @@ namespace LivePathEffect { LPEPathLength::LPEPathLength(LivePathEffectObject *lpeobject) : Effect(lpeobject), - scale(_("Scale"), _("Scaling factor"), "scale", &wr, this, 1.0), + scale(_("Scale:"), _("Scaling factor"), "scale", &wr, this, 1.0), info_text(this), - unit(_("Unit"), _("Unit"), "unit", &wr, this), + unit(_("Unit:"), _("Unit"), "unit", &wr, this), display_unit(_("Display unit"), _("Print unit after path length"), "display_unit", &wr, this, true) { registerParameter(dynamic_cast<Parameter *>(&scale)); @@ -51,11 +52,11 @@ LPEPathLength::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & p /* convert the measured length to the correct unit ... */ double lengthval = Geom::length(pwd2_in) * scale; - gboolean success = sp_convert_distance(&lengthval, &sp_unit_get_by_id(SP_UNIT_PX), unit); + lengthval = Inkscape::Util::Quantity::convert(lengthval, "px", unit.get_abbreviation()); /* ... set it as the canvas text ... */ gchar *arc_length = g_strdup_printf("%.2f %s", lengthval, - display_unit ? (success ? unit.get_abbreviation() : "px") : ""); + display_unit ? unit.get_abbreviation() : ""); info_text.param_setValue(arc_length); g_free(arc_length); |
