From 2408c43789dd50d9219f5bea349ed9543e4e39ea Mon Sep 17 00:00:00 2001 From: dooglus Date: Thu, 30 Aug 2007 01:10:34 +0000 Subject: [PATCH] Forgot to include these 2 in the last commit. Implement new method toggle_select_ducks_in_box(). git-svn-id: http://svn.voria.com/code@563 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/duckmatic.cpp | 19 +++++++++++++++++++ synfig-studio/trunk/src/gtkmm/duckmatic.h | 2 ++ 2 files changed, 21 insertions(+) diff --git a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp index a2cc733..5dbbaf0 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp @@ -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; diff --git a/synfig-studio/trunk/src/gtkmm/duckmatic.h b/synfig-studio/trunk/src/gtkmm/duckmatic.h index a3012a8..ad251a2 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.h +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.h @@ -307,6 +307,8 @@ public: void select_duck(const etl::handle &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); -- 2.7.4