freehand draw for velocity only affects selected notes, if any are selected (#9491)

This commit is contained in:
Paul Davis 2023-10-18 08:26:42 -06:00
parent edc0e636e2
commit d88b9d36ca
2 changed files with 13 additions and 1 deletions

View file

@ -3392,7 +3392,9 @@ MidiRegionView::change_note_length (NoteBase* event, Temporal::Beats t)
void void
MidiRegionView::begin_drag_edit (std::string const & why) MidiRegionView::begin_drag_edit (std::string const & why)
{ {
if (!_selected) {
trackview.editor().get_selection().set (this, true); trackview.editor().get_selection().set (this, true);
}
start_note_diff_command (why); start_note_diff_command (why);
} }

View file

@ -292,7 +292,17 @@ VelocityGhostRegion::note_selected (NoteBase* ev)
void void
VelocityGhostRegion::lollis_between (int x0, int x1, std::vector<NoteBase*>& within) VelocityGhostRegion::lollis_between (int x0, int x1, std::vector<NoteBase*>& within)
{ {
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (&parent_rv);
assert (mrv);
MidiRegionView::Selection const & sel (mrv->selection());
bool only_selected = !sel.empty();
for (auto & gev : events) { for (auto & gev : events) {
if (only_selected) {
if (!gev.second->event->selected()) {
continue;
}
}
ArdourCanvas::Lollipop* l = dynamic_cast<ArdourCanvas::Lollipop*> (gev.second->item); ArdourCanvas::Lollipop* l = dynamic_cast<ArdourCanvas::Lollipop*> (gev.second->item);
if (l) { if (l) {
ArdourCanvas::Duple pos = l->item_to_canvas (ArdourCanvas::Duple (l->x(), l->y0())); ArdourCanvas::Duple pos = l->item_to_canvas (ArdourCanvas::Duple (l->x(), l->y0()));