Module: synfig
Branch: genete_width_points
Commit: f8a2041bb5decb36044505306c1b5927fee45718
URL:    
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig;a=commit;h=f8a2041bb5decb36044505306c1b5927fee45718

Author: Carlos Lopez <car...@pcnuevo.(none)>
Date:   Tue Aug  4 11:39:51 2009 +0200

Move the interpolate function to a proper place.

---

 .../src/modules/mod_geometry/enhanced_outline.h    |    4 ++
 synfig-core/trunk/src/synfig/wlinepoint.cpp        |   31 +-------------------
 synfig-core/trunk/src/synfig/wlinepoint.h          |    4 +--
 3 files changed, 6 insertions(+), 33 deletions(-)

diff --git a/synfig-core/trunk/src/modules/mod_geometry/enhanced_outline.h 
b/synfig-core/trunk/src/modules/mod_geometry/enhanced_outline.h
index 49d8867..1aa79f0 100644
--- a/synfig-core/trunk/src/modules/mod_geometry/enhanced_outline.h
+++ b/synfig-core/trunk/src/modules/mod_geometry/enhanced_outline.h
@@ -46,6 +46,7 @@ using namespace etl;
 
 class EnhancedOutline : public synfig::Layer_Polygon
 {
+       friend class WLinePoint;
        SYNFIG_LAYER_MODULE_EXT
 private:
 
@@ -89,6 +90,9 @@ public:
        virtual bool set_version(const String 
&ver){if(ver=="0.1")old_version=true; return true;}
        virtual void reset_version(){old_version=false;}
 
+       // Returns the linear interpolation width between p1 and p2 at position 
'pos'
+       Real interpolate(WLinePoint &p1, WLinePoint &p2, Real pos);
+
 };
 
 /* === E N D =============================================================== */
diff --git a/synfig-core/trunk/src/synfig/wlinepoint.cpp 
b/synfig-core/trunk/src/synfig/wlinepoint.cpp
index 456c658..c00e916 100644
--- a/synfig-core/trunk/src/synfig/wlinepoint.cpp
+++ b/synfig-core/trunk/src/synfig/wlinepoint.cpp
@@ -45,36 +45,7 @@ using namespace synfig;
 
 /* === P R O C E D U R E S ================================================= */
 
-Real
-synfig::interpolate(WLinePoint &p0, WLinePoint &p1, Real pos)
-{
-       Real pos0 = p0.get_position();
-       Real pos1 = p1.get_position();
-       if (pos0 > pos1)
-       // They are inversed so it is interpreted as a loop
-       {
-               if(pos < pos0)
-               {
-                       pos0=p1.get_position()-1;
-                       pos1=p0.get_position();
-               }
-               else if (pos > pos1)
-               {
-                       pos0=p1.get_position();
-                       pos1=p0.get_position()+1;
-               }
-               //else
-                       //synfig::info("Found Width Interpolation swaped");
-       }
-       if (pos < pos0)
-               return p0.get_width();
-       else if (pos > pos1)
-               return p1.get_width();
-       else if (pos0==pos1)
-               return (p0.get_width()+p1.get_width())/2.0;
-       else
-               return (p0.get_width()+ 
(p1.get_width()-p0.get_width())*(pos-pos0)/(pos1-pos0));
-}
+
 
 /* === M E T H O D S ======================================================= */
 
diff --git a/synfig-core/trunk/src/synfig/wlinepoint.h 
b/synfig-core/trunk/src/synfig/wlinepoint.h
index f692667..1f87362 100644
--- a/synfig-core/trunk/src/synfig/wlinepoint.h
+++ b/synfig-core/trunk/src/synfig/wlinepoint.h
@@ -40,9 +40,7 @@
 
 namespace synfig {
 
-class WLinePoint;
-// Returns the linear interpolation width between p1 and p2 at position 'pos'
-Real interpolate(WLinePoint &p1, WLinePoint &p2, Real pos);
+
 
 class WLinePoint : public UniqueID
 {


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to