From 92eb33f5e953a0e3f5bb6cd9f068f6787e209901 Mon Sep 17 00:00:00 2001 From: dooglus Date: Mon, 26 Mar 2007 00:02:46 +0000 Subject: [PATCH] Added a few comments and increase some code readability. git-svn-id: http://svn.voria.com/code@387 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp b/synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp index 450cd53..4ea8de6 100644 --- a/synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp @@ -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()); -- 2.7.4