13
0

fix note selection behaviour, hopefully ... perhaps

git-svn-id: svn://localhost/ardour2/branches/3.0@5657 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-09-12 16:46:19 +00:00
parent d98302ae2c
commit 93bc6e5b58
2 changed files with 24 additions and 9 deletions

View File

@ -3392,7 +3392,7 @@ NoteDrag::start_grab (GdkEvent* event, Gdk::Cursor *)
ArdourCanvas::CanvasNote* cnote = dynamic_cast<ArdourCanvas::CanvasNote*>(_item);
if (!(was_selected = cnote->selected())) {
/* tertiary-click means extend selection - we'll do that on button release,
so don't add it here, because otherwise we make it hard to figure
out the "extend-to" range.
@ -3401,7 +3401,13 @@ NoteDrag::start_grab (GdkEvent* event, Gdk::Cursor *)
bool extend = Keyboard::modifier_state_equals (event->button.state, Keyboard::TertiaryModifier);
if (!extend) {
region->note_selected (cnote, true);
bool add = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier);
if (add) {
region->note_selected (cnote, true);
} else {
region->unique_select (cnote);
}
}
}
}

View File

@ -1499,17 +1499,26 @@ void
MidiRegionView::unique_select(ArdourCanvas::CanvasNoteEvent* ev)
{
for (Selection::iterator i = _selection.begin(); i != _selection.end(); ) {
Selection::iterator tmp = i;
++tmp;
if ((*i) != ev) {
remove_from_selection (*i);
}
i = tmp;
Selection::iterator tmp = i;
++tmp;
(*i)->selected (false);
_selection.erase (i);
i = tmp;
} else {
++i;
}
}
/* don't bother with removing this regionview from the editor selection,
since we're about to add another note, and thus put/keep this
regionview in the editor selection.
*/
if (!ev->selected()) {
add_to_selection (ev);
}