Forgot to include these 2 in the last commit. Implement new method toggle_select_duc...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 30 Aug 2007 01:10:34 +0000 (01:10 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 30 Aug 2007 01:10:34 +0000 (01:10 +0000)
git-svn-id: http://svn.voria.com/code@563 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/duckmatic.cpp
synfig-studio/trunk/src/gtkmm/duckmatic.h

index a2cc733..5dbbaf0 100644 (file)
@@ -276,6 +276,25 @@ Duckmatic::select_all_ducks()
 }
 
 void
+Duckmatic::toggle_select_ducks_in_box(const synfig::Vector& tl,const synfig::Vector& br)
+{
+       Vector vmin, vmax;
+       vmin[0]=std::min(tl[0],br[0]);
+       vmin[1]=std::min(tl[1],br[1]);
+       vmax[0]=std::max(tl[0],br[0]);
+       vmax[1]=std::max(tl[1],br[1]);
+
+       DuckMap::const_iterator iter;
+       for(iter=duck_map.begin();iter!=duck_map.end();++iter)
+       {
+               Point p(iter->second->get_trans_point());
+               if(p[0]<=vmax[0] && p[0]>=vmin[0] && p[1]<=vmax[1] && p[1]>=vmin[1] &&
+                  is_duck_group_selectable(iter->second))
+                       toggle_select_duck(iter->second);
+       }
+}
+
+void
 Duckmatic::select_ducks_in_box(const synfig::Vector& tl,const synfig::Vector& br)
 {
        Vector vmin, vmax;
index a3012a8..ad251a2 100644 (file)
@@ -307,6 +307,8 @@ public:
 
        void select_duck(const etl::handle<Duck> &duck);
 
+       void toggle_select_ducks_in_box(const synfig::Vector& tl,const synfig::Vector& br);
+
        void select_ducks_in_box(const synfig::Vector& tl,const synfig::Vector& br);
 
        void unselect_duck(const etl::handle<Duck> &duck);