From: Nikita Kitaev Date: Tue, 1 Dec 2009 03:00:55 +0000 (-0800) Subject: Restrain dragging for link-to-bline ducks in tools X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=14a260f30125c023a5a23161adfb2634de0ba1e6;p=synfig.git Restrain dragging for link-to-bline ducks in tools --- diff --git a/synfig-studio/src/gtkmm/mod_mirror/state_mirror.cpp b/synfig-studio/src/gtkmm/mod_mirror/state_mirror.cpp index b9688d0..cf2b827 100644 --- a/synfig-studio/src/gtkmm/mod_mirror/state_mirror.cpp +++ b/synfig-studio/src/gtkmm/mod_mirror/state_mirror.cpp @@ -267,6 +267,8 @@ DuckDrag_Mirror::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector) const DuckList selected_ducks(duckmatic->get_selected_ducks()); DuckList::const_iterator iter; + Time time(duckmatic->get_time()); + // do the 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 || @@ -277,7 +279,7 @@ DuckDrag_Mirror::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector) if (axis==AXIS_X) p[0] = -(p[0]-center[0]) + center[0]; else if (axis==AXIS_Y) p[1] = -(p[1]-center[1]) + center[1]; - (*iter)->set_trans_point(p); + (*iter)->set_trans_point(p, time); } // then do the other ducks @@ -294,7 +296,7 @@ DuckDrag_Mirror::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector) if (axis==AXIS_X) p[0] = -(p[0]-center[0]) + center[0]; else if (axis==AXIS_Y) p[1] = -(p[1]-center[1]) + center[1]; - (*iter)->set_trans_point(p); + (*iter)->set_trans_point(p, time); } } diff --git a/synfig-studio/src/gtkmm/state_smoothmove.cpp b/synfig-studio/src/gtkmm/state_smoothmove.cpp index 56ca977..5cc7f1e 100644 --- a/synfig-studio/src/gtkmm/state_smoothmove.cpp +++ b/synfig-studio/src/gtkmm/state_smoothmove.cpp @@ -262,6 +262,8 @@ DuckDrag_SmoothMove::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vecto int i; + Time time(duckmatic->get_time()); + // process vertex and position ducks first for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++) { @@ -276,7 +278,7 @@ DuckDrag_SmoothMove::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vecto dist=0; last_[i]=vect*dist; - (*iter)->set_trans_point(p+last_[i]); + (*iter)->set_trans_point(p+last_[i], time); } // then process non vertex and non position ducks @@ -293,7 +295,7 @@ DuckDrag_SmoothMove::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vecto dist=0; last_[i]=vect*dist; - (*iter)->set_trans_point(p+last_[i]); + (*iter)->set_trans_point(p+last_[i], time); } last_translate_=vect; diff --git a/synfig-studio/src/gtkmm/state_transform.cpp b/synfig-studio/src/gtkmm/state_transform.cpp index 64a1efa..0a9f2ae 100644 --- a/synfig-studio/src/gtkmm/state_transform.cpp +++ b/synfig-studio/src/gtkmm/state_transform.cpp @@ -731,7 +731,7 @@ DuckDrag_Combo::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector) p[1]=-sine*x[0]+cosine*x[1]; if(scale)p*=mag; p+=center; - (*iter)->set_trans_point(p); + (*iter)->set_trans_point(p, time); } for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++) { @@ -743,7 +743,7 @@ DuckDrag_Combo::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector) p[1]=-sine*x[0]+cosine*x[1]; if(scale)p*=mag; p+=center; - (*iter)->set_trans_point(p); + (*iter)->set_trans_point(p, time); } } else if (scale) { @@ -779,7 +779,7 @@ DuckDrag_Combo::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector) p[0]*=vect[0]; p[1]*=vect[1]; p+=center; - (*iter)->set_trans_point(p); + (*iter)->set_trans_point(p, time); } for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++) { @@ -790,7 +790,7 @@ DuckDrag_Combo::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector) p[0]*=vect[0]; p[1]*=vect[1]; p+=center; - (*iter)->set_trans_point(p); + (*iter)->set_trans_point(p, time); } } last_move=vect;