From: dooglus Date: Wed, 26 Nov 2008 19:22:19 +0000 (+0000) Subject: Move the test for whether the duck is the correct type to before the distance calcula... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ee7b927fa4d341a76bf2e777d21843d638a8f039;p=synfig.git Move the test for whether the duck is the correct type to before the distance calculation. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2288 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp index 485b9f6..0032e4f 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp @@ -881,8 +881,10 @@ Duckmatic::find_duck(synfig::Point point, synfig::Real radius, Duck::Type type) { const Duck::Handle& duck(iter->second); - if(duck->get_ignore()) + if(duck->get_ignore() || + (duck->get_type() && !(type & duck->get_type()))) continue; + Real dist((duck->get_trans_point()-point).mag_squared()); if(duck->get_type()&Duck::TYPE_VERTEX) @@ -892,7 +894,7 @@ Duckmatic::find_duck(synfig::Point point, synfig::Real radius, Duck::Type type) else if(duck->get_type()&Duck::TYPE_RADIUS) dist*=0.9999; - if(distget_type() && (!(type & duck->get_type())) ) ) + if(dist