summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 00d1e41)
raw | patch | inline | side by side (parent: 00d1e41)
author | cilix42 <cilix42@users.sourceforge.net> | |
Sun, 14 Sep 2008 18:29:20 +0000 (18:29 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Sun, 14 Sep 2008 18:29:20 +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 a032026b7dbfd259a77a98438c4a9cd5f8cc609c..15a5df1652908e019db423282d9d8c62ae5771c7 100644 (file)
LPEPathLength::LPEPathLength(LivePathEffectObject *lpeobject) :
Effect(lpeobject),
+ scale(_("Scale"), _("Scaling factor"), "scale", &wr, this, 1.0),
info_text(this),
unit(_("Unit"), _("Unit"), "unit", &wr, this)
{
+ registerParameter(dynamic_cast<Parameter *>(&scale));
registerParameter(dynamic_cast<Parameter *>(&info_text));
registerParameter(dynamic_cast<Parameter *>(&unit));
}
}
-bool
+void
LPEPathLength::hideCanvasText() {
// this is only used in sp-lpe-item.cpp to hide the canvas text when the effect is invisible
info_text.param_setValue("");
-// TODO must return something to avoid nasty bugs
- g_warning("random value");
}
Geom::Piecewise<Geom::D2<Geom::SBasis> >
using namespace Geom;
/* convert the measured length to the correct unit ... */
- double lengthval = Geom::length(pwd2_in);
+ double lengthval = Geom::length(pwd2_in) * scale;
gboolean success = sp_convert_distance(&lengthval, &sp_unit_get_by_id(SP_UNIT_PX), unit);
/* ... set it as the canvas text ... */
index 5a4638d904b66a6f901de9a725168be91032029c..e032bf3c946880d491f2ce2dbbf6bf92e6d18b6f 100644 (file)
virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in);
- bool hideCanvasText();
+ void hideCanvasText();
private:
LPEPathLength(const LPEPathLength&);
LPEPathLength& operator=(const LPEPathLength&);
+ ScalarParam scale;
TextParamInternal info_text;
UnitParam unit;
};