Added a few comments and increase some code readability.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 26 Mar 2007 00:02:46 +0000 (00:02 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 26 Mar 2007 00:02:46 +0000 (00:02 +0000)
git-svn-id: http://svn.voria.com/code@387 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp

index 450cd53..4ea8de6 100644 (file)
@@ -260,9 +260,13 @@ DuckDrag_SmoothMove::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vecto
 
        int i;
 
+       // process vertex and position ducks first
        for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
        {
-               if(((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION))continue;
+               // skip this duck if it is NOT a vertex or a position
+               if (((*iter)->get_type() != Duck::TYPE_VERTEX &&
+                        (*iter)->get_type() != Duck::TYPE_POSITION))
+                       continue;
                Point p(positions[i]);
 
                float dist(1.0f-(p-drag_offset_).mag()/get_radius());
@@ -273,9 +277,13 @@ DuckDrag_SmoothMove::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vecto
                (*iter)->set_trans_point(p+last_[i]);
        }
 
+       // then process non vertex and non position ducks
        for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
        {
-               if(!((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION))continue;
+               // skip this duck if it IS a vertex or a position
+               if (!((*iter)->get_type() != Duck::TYPE_VERTEX &&
+                        (*iter)->get_type() != Duck::TYPE_POSITION))
+                       continue;
                Point p(positions[i]);
 
                float dist(1.0f-(p-drag_offset_).mag()/get_radius());