From: dooglus Date: Wed, 26 Nov 2008 17:09:53 +0000 (+0000) Subject: Show position ducks on top of vertex ducks, then tangent ducks, then the rest. Until... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ee303c8406912a41b5e6c838b131c0777abd8014;p=synfig.git Show position ducks on top of vertex ducks, then tangent ducks, then the rest. Until now the order was random. And when hovering the mouse over a set of ducks give preference to 'tangent 1' over 'tangent 2'. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2283 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp index c620329..485b9f6 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp @@ -399,8 +399,14 @@ Duckmatic::get_duck_list()const { DuckList ret; DuckMap::const_iterator iter; + for(iter=duck_map.begin();iter!=duck_map.end();++iter) if (iter->second->get_type()&Duck::TYPE_POSITION) ret.push_back(iter->second); + for(iter=duck_map.begin();iter!=duck_map.end();++iter) if (iter->second->get_type()&Duck::TYPE_VERTEX ) ret.push_back(iter->second); + for(iter=duck_map.begin();iter!=duck_map.end();++iter) if (iter->second->get_type()&Duck::TYPE_TANGENT ) ret.push_back(iter->second); for(iter=duck_map.begin();iter!=duck_map.end();++iter) - ret.push_back(iter->second); + if (!(iter->second->get_type()&Duck::TYPE_POSITION) && + !(iter->second->get_type()&Duck::TYPE_VERTEX) && + !(iter->second->get_type()&Duck::TYPE_TANGENT)) + ret.push_back(iter->second); return ret; } @@ -881,15 +887,15 @@ Duckmatic::find_duck(synfig::Point point, synfig::Real radius, Duck::Type type) if(duck->get_type()&Duck::TYPE_VERTEX) dist*=1.0001; + else if(duck->get_type()&Duck::TYPE_TANGENT && duck->get_scalar()>0) + dist*=1.00005; else if(duck->get_type()&Duck::TYPE_RADIUS) dist*=0.9999; - if(dist<=closest && !( duck->get_type() && (!(type & duck->get_type())) ) ) + if(distget_type() && (!(type & duck->get_type())) ) ) { - { - closest=dist; - ret=duck; - } + closest=dist; + ret=duck; } }