MIDI editing: fix selection during note resize drags
The ::start_drag() implementation now defers add/extend selection logic to MidiRegionView::note_selected(), and drops the original limitation that we did not do extend-selection on button press, only button release.
This commit is contained in:
parent
e01452c6a6
commit
789abc561d
@ -2714,23 +2714,10 @@ NoteResizeDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*ignored*/)
|
|||||||
|
|
||||||
if (!(_was_selected = cnote->selected())) {
|
if (!(_was_selected = cnote->selected())) {
|
||||||
|
|
||||||
/* tertiary-click means extend selection - we'll do that on button release,
|
const bool extend = Keyboard::modifier_state_equals (event->button.state, Keyboard::TertiaryModifier);
|
||||||
so don't add it here, because otherwise we make it hard to figure
|
const bool add = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier);
|
||||||
out the "extend-to" range.
|
|
||||||
*/
|
|
||||||
|
|
||||||
bool extend = Keyboard::modifier_state_equals (event->button.state, Keyboard::TertiaryModifier);
|
region->note_selected (cnote, add, extend);
|
||||||
|
|
||||||
if (!extend) {
|
|
||||||
bool add = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier);
|
|
||||||
|
|
||||||
if (add) {
|
|
||||||
region->note_selected (cnote, true);
|
|
||||||
} else {
|
|
||||||
_editor->get_selection().clear_points();
|
|
||||||
region->unique_select (cnote);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2802,25 +2789,10 @@ NoteResizeDrag::finished (GdkEvent* event, bool movement_occurred)
|
|||||||
region->note_deselected (cnote);
|
region->note_deselected (cnote);
|
||||||
changed = true;
|
changed = true;
|
||||||
} else {
|
} else {
|
||||||
_editor->get_selection().clear_points();
|
/* handled during button press */
|
||||||
region->unique_select (cnote);
|
|
||||||
changed = true;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bool extend = Keyboard::modifier_state_equals (event->button.state, Keyboard::TertiaryModifier);
|
/* handled during button press */
|
||||||
bool add = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier);
|
|
||||||
|
|
||||||
if (!extend && !add && region->selection_size() > 1) {
|
|
||||||
_editor->get_selection().clear_points();
|
|
||||||
region->unique_select (cnote);
|
|
||||||
changed = true;
|
|
||||||
} else if (extend) {
|
|
||||||
region->note_selected (cnote, true, true);
|
|
||||||
changed = true;
|
|
||||||
} else {
|
|
||||||
/* it was added during button press */
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
|
Loading…
Reference in New Issue
Block a user