From: cilix42 Date: Thu, 31 Jul 2008 17:13:05 +0000 (+0000) Subject: Make lpe-path_length use TextParamInternal X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=29be0375ca0e8a833abd3558323fb4e7922b2a41;p=inkscape.git Make lpe-path_length use TextParamInternal --- diff --git a/src/live_effects/lpe-path_length.cpp b/src/live_effects/lpe-path_length.cpp index 7ff154412..3b9b07c82 100644 --- a/src/live_effects/lpe-path_length.cpp +++ b/src/live_effects/lpe-path_length.cpp @@ -22,7 +22,7 @@ namespace LivePathEffect { LPEPathLength::LPEPathLength(LivePathEffectObject *lpeobject) : Effect(lpeobject), - info_text(_("Info text"), _("Parameter for text creation"), "info_text", &wr, this, ""), + info_text(this), unit(_("Unit"), _("Unit"), "unit", &wr, this) { registerParameter(dynamic_cast(&info_text)); @@ -44,7 +44,7 @@ LPEPathLength::doEffect_pwd2 (Geom::Piecewise > 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("%8.2f %s", lengthval, success ? unit.get_abbreviation() : "px"); + gchar *arc_length = g_strdup_printf("%.2f %s", lengthval, success ? unit.get_abbreviation() : "px"); info_text.param_setValue(arc_length); g_free(arc_length); @@ -56,7 +56,7 @@ LPEPathLength::doEffect_pwd2 (Geom::Piecewise > const & p Point c; double area; if (centroid(pwd2_in, c, area)) { - g_print ("Area is zero\n"); + //g_print ("Area is zero\n"); } //g_print ("Area: %f\n", area); diff --git a/src/live_effects/lpe-path_length.h b/src/live_effects/lpe-path_length.h index 63f5ad397..1ec5165e9 100644 --- a/src/live_effects/lpe-path_length.h +++ b/src/live_effects/lpe-path_length.h @@ -31,7 +31,7 @@ public: private: LPEPathLength(const LPEPathLength&); LPEPathLength& operator=(const LPEPathLength&); - TextParam info_text; + TextParamInternal info_text; UnitParam unit; }; diff --git a/src/live_effects/lpe-ruler.cpp b/src/live_effects/lpe-ruler.cpp index f60c7b9fa..6711fe3f0 100644 --- a/src/live_effects/lpe-ruler.cpp +++ b/src/live_effects/lpe-ruler.cpp @@ -95,7 +95,7 @@ LPERuler::doEffect_pwd2 (Geom::Piecewise > const & pwd2_i gboolean success = sp_convert_distance(&lengthval, &sp_unit_get_by_id(SP_UNIT_PX), unit); /* ... set it as the canvas text ... */ - gchar *dist = g_strdup_printf("%8.2f %s", lengthval, success ? unit.get_abbreviation() : "px"); + gchar *dist = g_strdup_printf("%.2f %s", lengthval, success ? unit.get_abbreviation() : "px"); info_text.param_setValue(dist); g_free(dist);