summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1a37893)
raw | patch | inline | side by side (parent: 1a37893)
author | cilix42 <cilix42@users.sourceforge.net> | |
Sun, 14 Sep 2008 18:29:40 +0000 (18:29 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Sun, 14 Sep 2008 18:29:40 +0000 (18:29 +0000) |
src/live_effects/lpe-path_length.cpp | patch | blob | history | |
src/live_effects/lpe-path_length.h | patch | blob | history |
index 15a5df1652908e019db423282d9d8c62ae5771c7..e33a160025ccf7fdbce09ddaeaf4c747371fbdbe 100644 (file)
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()
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);
index e032bf3c946880d491f2ce2dbbf6bf92e6d18b6f..e108e770aa08c88ffc82dc0cee4d56bc6bb6c5b8 100644 (file)
#include "live_effects/effect.h"
#include "live_effects/parameter/text.h"
#include "live_effects/parameter/unit.h"
+#include "live_effects/parameter/bool.h"
namespace Inkscape {
namespace LivePathEffect {
ScalarParam scale;
TextParamInternal info_text;
UnitParam unit;
+ BoolParam display_unit;
};
} //namespace LivePathEffect