diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-07-19 20:31:57 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-07-19 20:31:57 +0000 |
| commit | 5b8a6e510cb69d33bc8834a7586142be800471b5 (patch) | |
| tree | 80b05fee53e72d25f56def6dfd14e104c18f8d45 /src/live_effects/lpe-path_length.cpp | |
| parent | Ported "ui/widget/style-swatch.*". (diff) | |
| download | inkscape-5b8a6e510cb69d33bc8834a7586142be800471b5.tar.gz inkscape-5b8a6e510cb69d33bc8834a7586142be800471b5.zip | |
Ported "live_effects/parameter/unit.*".
(bzr r12380.1.41)
Diffstat (limited to 'src/live_effects/lpe-path_length.cpp')
| -rw-r--r-- | src/live_effects/lpe-path_length.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/live_effects/lpe-path_length.cpp b/src/live_effects/lpe-path_length.cpp index d3edcda27..504fb53c0 100644 --- a/src/live_effects/lpe-path_length.cpp +++ b/src/live_effects/lpe-path_length.cpp @@ -15,6 +15,7 @@ #include "live_effects/lpe-path_length.h" #include "sp-metrics.h" +#include "util/units.h" #include "2geom/sbasis-geometric.h" @@ -52,11 +53,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); |
