From ed1e29adfd9e7702a8abbeb58b0b17c1a611b453 Mon Sep 17 00:00:00 2001 From: Yohanan <23298480+yohannd1@users.noreply.github.com> Date: Sun, 1 Feb 2026 13:00:27 -0300 Subject: [PATCH] Fix velocity/panning change affecting unselected notes (#8201) Fixes #8200. Scrolling to change velocity/panning can affect unselected notes if hovering over them in the bottom section of the piano roll. This PR addresses that. --- src/gui/editors/PianoRoll.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 09d975625..0d66fed18 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -4055,15 +4055,31 @@ void PianoRoll::wheelEvent(QWheelEvent * we ) // When alt is pressed we only edit the note under the cursor bool altPressed = we->modifiers() & Qt::AltModifier; + // go through notes to figure out which one we want to change NoteVector nv; + bool isSelection = false; for ( Note * i : m_midiClip->notes() ) { - if( i->withinRange( ticks_start, ticks_end ) || ( i->selected() && !altPressed ) ) + if (i->selected() && !altPressed) // found a selected note + { + if (!isSelection) + { + // drop other notes if we are realizing this is a selection now + isSelection = true; + nv.clear(); + } + + nv.push_back(i); + } + + // not on selection - just push back the note if it is within range + if (!isSelection && i->withinRange(ticks_start, ticks_end)) { nv.push_back(i); } } + if( nv.size() > 0 ) { const int step = (we->angleDelta().y() > 0 ? 1 : -1) * (we->inverted() ? -1 : 1);