diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2008-09-14 18:29:40 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2008-09-14 18:29:40 +0000 |
| commit | 57407e5276299e0a7adce07c3099f77ba17ec334 (patch) | |
| tree | aee2c9dec151d570fcd9b4338109c904a531fdf0 /src/live_effects/lpe-path_length.cpp | |
| parent | Scaling factor for lpe-path-length (diff) | |
| download | inkscape-57407e5276299e0a7adce07c3099f77ba17ec334.tar.gz inkscape-57407e5276299e0a7adce07c3099f77ba17ec334.zip | |
Make displaying of unit in lpe-path-length optional
(bzr r6812)
Diffstat (limited to 'src/live_effects/lpe-path_length.cpp')
| -rw-r--r-- | src/live_effects/lpe-path_length.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/live_effects/lpe-path_length.cpp b/src/live_effects/lpe-path_length.cpp index 15a5df165..e33a16002 100644 --- a/src/live_effects/lpe-path_length.cpp +++ b/src/live_effects/lpe-path_length.cpp @@ -24,11 +24,13 @@ LPEPathLength::LPEPathLength(LivePathEffectObject *lpeobject) : Effect(lpeobject), 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)); registerParameter(dynamic_cast<Parameter *>(&info_text)); registerParameter(dynamic_cast<Parameter *>(&unit)); + registerParameter(dynamic_cast<Parameter *>(&display_unit)); } LPEPathLength::~LPEPathLength() @@ -52,7 +54,8 @@ LPEPathLength::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & p gboolean success = sp_convert_distance(&lengthval, &sp_unit_get_by_id(SP_UNIT_PX), unit); /* ... set it as the canvas text ... */ - gchar *arc_length = g_strdup_printf("%.2f %s", lengthval, success ? unit.get_abbreviation() : "px"); + gchar *arc_length = g_strdup_printf("%.2f %s", lengthval, + display_unit ? (success ? unit.get_abbreviation() : "px") : ""); info_text.param_setValue(arc_length); g_free(arc_length); |
