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.
This commit is contained in:
Yohanan
2026-02-01 13:00:27 -03:00
committed by GitHub
parent e076446fd3
commit ed1e29adfd

View File

@@ -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);