X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Fsrc%2Fgtkmm%2Fstate_smoothmove.cpp;h=85442cf48284c7ebf6a28b801a9e781edd927492;hb=ea136b4b5f94deb671d1a475111a9b1083e98186;hp=78f617b22402a14109e13cf160045264686e7310;hpb=233516438ff772fc41f365e7d323acae89fc3ac3;p=synfig.git diff --git a/synfig-studio/src/gtkmm/state_smoothmove.cpp b/synfig-studio/src/gtkmm/state_smoothmove.cpp index 78f617b..85442cf 100644 --- a/synfig-studio/src/gtkmm/state_smoothmove.cpp +++ b/synfig-studio/src/gtkmm/state_smoothmove.cpp @@ -34,6 +34,8 @@ #include #include +#include +#include #include #include @@ -299,6 +301,9 @@ DuckDrag_SmoothMove::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vecto (*iter)->set_trans_point(p+last_[i], time); } + // then patch up the tangents for the vertices we've moved + duckmatic->update_ducks(); + last_translate_=vect; //snap=Vector(0,0); } @@ -319,9 +324,45 @@ DuckDrag_SmoothMove::end_duck_drag(Duckmatic* duckmatic) for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++) { if(last_[i].mag()>0.0001) - if(!(*iter)->signal_edited()((*iter)->get_point())) { - throw String("Bad Move"); + if ((*iter)->get_type() == Duck::TYPE_ANGLE) + { + if(!(*iter)->signal_edited_angle()((*iter)->get_rotations())) + { + throw String("Bad edit"); + } + } + else if (App::restrict_radius_ducks && + (*iter)->is_radius()) + { + Point point((*iter)->get_point()); + bool changed = false; + + if (point[0] < 0) + { + point[0] = 0; + changed = true; + } + if (point[1] < 0) + { + point[1] = 0; + changed = true; + } + + if (changed) (*iter)->set_point(point); + + if(!(*iter)->signal_edited()(point)) + { + throw String("Bad edit"); + } + } + else + { + if(!(*iter)->signal_edited()((*iter)->get_point())) + { + throw String("Bad edit"); + } + } } } //duckmatic->get_selected_ducks()=new_set;