Author: Carlos Lopez <[email protected]>
Date:   Wed Mar 16 21:59:14 2011 +0100

Replace homogeneous width by smoothness. It controls the interpolation between 
widthpoints

---

 .../src/modules/mod_geometry/advanced_outline.cpp  |   18 ++++++++++++------
 .../src/modules/mod_geometry/advanced_outline.h    |    2 +-
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/synfig-core/src/modules/mod_geometry/advanced_outline.cpp 
b/synfig-core/src/modules/mod_geometry/advanced_outline.cpp
index 908b816..50d7b05 100644
--- a/synfig-core/src/modules/mod_geometry/advanced_outline.cpp
+++ b/synfig-core/src/modules/mod_geometry/advanced_outline.cpp
@@ -78,7 +78,7 @@ Advanced_Outline::Advanced_Outline()
        sharp_cusps_=true;
        width_=1.0f;
        expand_=0;
-       homogeneous_width_=true;
+       smoothness_=0.5;
        clear();
 
        vector<BLinePoint> bline_point_list;
@@ -366,7 +366,13 @@ Advanced_Outline::set_param(const String & param, const 
ValueBase &value)
        IMPORT_AS(sharp_cusps_, "sharp_cusps");
        IMPORT_AS(width_,"width");
        IMPORT_AS(expand_, "expand");
-       IMPORT_AS(homogeneous_width_, "homogeneous_width");
+       if(param=="smoothness" && value.get_type()==ValueBase::TYPE_REAL)
+       {
+               if(value > 1.0) smoothness_=1.0;
+               else if(value < 0.0) smoothness_=0.0;
+               else smoothness_=value;
+               return true;
+       }
        if(param=="wplist" && value.get_type()==ValueBase::TYPE_LIST)
        {
                wplist_=value;
@@ -396,7 +402,7 @@ Advanced_Outline::get_param(const String& param)const
 {
        EXPORT_AS(bline_, "bline");
        EXPORT_AS(expand_, "expand");
-       EXPORT_AS(homogeneous_width_, "homogeneous_width");
+       EXPORT_AS(smoothness_, "smoothness");
        EXPORT_AS(round_tip_[0], "round_tip[0]");
        EXPORT_AS(round_tip_[1], "round_tip[1]");
        EXPORT_AS(sharp_cusps_, "sharp_cusps");
@@ -442,9 +448,9 @@ Advanced_Outline::get_param_vocab()const
                .set_local_name(_("Rounded End"))
                .set_description(_("Round off the tip"))
        );
-       ret.push_back(ParamDesc("homogeneous_width")
-               .set_local_name(_("Homogeneous"))
-               .set_description(_("When checked the width takes the length of 
the spline to interpolate"))
+       ret.push_back(ParamDesc("smoothness")
+               .set_local_name(_("Smoothness"))
+               .set_description(_("Determines the interpolation between 
withpoints. (0) Linear (1) Smooth"))
        );
        ret.push_back(ParamDesc("wplist")
                .set_local_name(_("Width Point List"))
diff --git a/synfig-core/src/modules/mod_geometry/advanced_outline.h 
b/synfig-core/src/modules/mod_geometry/advanced_outline.h
index 222a6de..c869abd 100644
--- a/synfig-core/src/modules/mod_geometry/advanced_outline.h
+++ b/synfig-core/src/modules/mod_geometry/advanced_outline.h
@@ -56,7 +56,7 @@ private:
        bool loop_;
        synfig::Real width_;
        synfig::Real expand_;
-       bool homogeneous_width_;
+       Real smoothness_;
 
 public:
 


------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to