From: cilix42 Date: Tue, 22 Jul 2008 12:41:32 +0000 (+0000) Subject: Scale parameter for lpe-ruler X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6f613e3526aa41f97c89c5c78f5520f4c060e391;p=inkscape.git Scale parameter for lpe-ruler --- diff --git a/src/live_effects/lpe-ruler.cpp b/src/live_effects/lpe-ruler.cpp index 89da4efe3..bd60966c8 100644 --- a/src/live_effects/lpe-ruler.cpp +++ b/src/live_effects/lpe-ruler.cpp @@ -23,10 +23,12 @@ namespace LivePathEffect { LPERuler::LPERuler(LivePathEffectObject *lpeobject) : Effect(lpeobject), mark_distance(_("Mark distance"), _("Distance between ruler marks"), "mark_distance", &wr, this, 50), - mark_length(_("Mark length"), _("Length of ruler marks"), "mark_length", &wr, this, 10) + mark_length(_("Mark length"), _("Length of ruler marks"), "mark_length", &wr, this, 10), + scale(_("Scale"), _("Scale factor for ruler distance"), "scale", &wr, this, 1.0) { registerParameter(dynamic_cast(&mark_distance)); registerParameter(dynamic_cast(&mark_length)); + registerParameter(dynamic_cast(&scale)); mark_distance.param_make_integer(); mark_length.param_make_integer(); @@ -51,7 +53,7 @@ LPERuler::doEffect_pwd2 (Geom::Piecewise > const & pwd2_i Point n(-rot90(dir) * mark_length); double length = L2(B - A); - g_print ("Distance: %8.2f\n", length); + g_print ("Distance: %8.2f\n", length * scale); Point C, D; for (int i = 0; i < length; i += static_cast(mark_distance)) { diff --git a/src/live_effects/lpe-ruler.h b/src/live_effects/lpe-ruler.h index 891217cc5..044b93b49 100644 --- a/src/live_effects/lpe-ruler.h +++ b/src/live_effects/lpe-ruler.h @@ -31,6 +31,7 @@ public: private: ScalarParam mark_distance; ScalarParam mark_length; + ScalarParam scale; LPERuler(const LPERuler&); LPERuler& operator=(const LPERuler&); };