Clear point selection when uniquely selecting a note.

- Also fix selection undo when creating notes w/control
	  in MouseContent mode.
This commit is contained in:
nick_m 2015-10-24 00:07:03 +11:00
parent 96c6da0804
commit 96524d863b
2 changed files with 10 additions and 4 deletions

View File

@ -2381,9 +2381,11 @@ NoteResizeDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*ignored*/)
/* has to be relative, may make no sense otherwise */
relative = true;
}
/* select this note; if it is already selected, preserve the existing selection,
otherwise make this note the only one selected.
*/
_editor->get_selection().clear_points();
region->note_selected (cnote, cnote->selected ());
}
@ -5298,11 +5300,9 @@ NoteDrag::start_grab (GdkEvent* event, Gdk::Cursor *)
if (add) {
_region->note_selected (_primary, true);
} else {
_editor->get_selection().clear_points();
_region->unique_select (_primary);
}
_editor->begin_reversible_selection_op(X_("Select Note Press"));
_editor->commit_reversible_selection_op();
}
}
}
@ -5419,13 +5419,16 @@ NoteDrag::finished (GdkEvent* ev, bool moved)
_region->note_deselected (_primary);
changed = true;
} else {
_editor->get_selection().clear_points();
_region->unique_select (_primary);
changed = true;
}
} else {
bool extend = Keyboard::modifier_state_equals (ev->button.state, Keyboard::TertiaryModifier);
bool add = Keyboard::modifier_state_equals (ev->button.state, Keyboard::PrimaryModifier);
if (!extend && !add && _region->selection_size() > 1) {
_editor->get_selection().clear_points();
_region->unique_select (_primary);
changed = true;
} else if (extend) {
@ -5433,6 +5436,8 @@ NoteDrag::finished (GdkEvent* ev, bool moved)
changed = true;
} else {
/* it was added during button press */
changed = true;
}
}

View File

@ -543,7 +543,6 @@ MidiRegionView::button_release (GdkEventButton* ev)
case MouseContent:
case MouseTimeFX:
{
clear_selection();
_mouse_changed_selection = true;
if (Keyboard::is_insert_note_event(ev)) {
@ -562,6 +561,8 @@ MidiRegionView::button_release (GdkEventButton* ev)
beats -= Evoral::Beats::tick();
create_note_at (editor.pixel_to_sample (event_x), event_y, beats, true);
} else {
clear_selection ();
}
break;