From 9cf07d9e2e127980c2edbfea4f92d0fa02f13310 Mon Sep 17 00:00:00 2001 From: dooglus Date: Thu, 30 Aug 2007 01:07:54 +0000 Subject: [PATCH] When dragging a box around some ducks, holding SHIFT adds the surrounded ducks to the selection, CTRL toggles them, SHIFT+CTRL unselects them, and holding no keys will cancel the existing selection and leave just the surrounded ducks selected. Previously CTRL and SHIFT both did the same thing (adding to the selection). git-svn-id: http://svn.voria.com/code@562 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/workarea.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/workarea.cpp b/synfig-studio/trunk/src/gtkmm/workarea.cpp index d357003..56ee2dc 100644 --- a/synfig-studio/trunk/src/gtkmm/workarea.cpp +++ b/synfig-studio/trunk/src/gtkmm/workarea.cpp @@ -1628,9 +1628,18 @@ WorkArea::on_drawing_area_event(GdkEvent *event) if(canvas_view->get_smach().process_event(EventBox(drag_point,mouse_pos,MouseButton(event->button.button),modifier))==Smach::RESULT_ACCEPT) return true; - if(!(modifier&GDK_CONTROL_MASK) && !(modifier&GDK_SHIFT_MASK)) + // when dragging a box around some ducks: + // SHIFT selects; CTRL toggles; SHIFT+CTRL unselects; clears all then selects + if(modifier&GDK_SHIFT_MASK) + select_ducks_in_box(drag_point,mouse_pos); + + if(modifier&GDK_CONTROL_MASK) + toggle_select_ducks_in_box(drag_point,mouse_pos); + else if(!(modifier&GDK_SHIFT_MASK)) + { clear_selected_ducks(); - select_ducks_in_box(drag_point,mouse_pos); + select_ducks_in_box(drag_point,mouse_pos); + } ret=true; } else -- 2.7.4