Skip to content

Commit ed1e29a

Browse files
authored
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.
1 parent e076446 commit ed1e29a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/gui/editors/PianoRoll.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4055,15 +4055,31 @@ void PianoRoll::wheelEvent(QWheelEvent * we )
40554055

40564056
// When alt is pressed we only edit the note under the cursor
40574057
bool altPressed = we->modifiers() & Qt::AltModifier;
4058+
40584059
// go through notes to figure out which one we want to change
40594060
NoteVector nv;
4061+
bool isSelection = false;
40604062
for ( Note * i : m_midiClip->notes() )
40614063
{
4062-
if( i->withinRange( ticks_start, ticks_end ) || ( i->selected() && !altPressed ) )
4064+
if (i->selected() && !altPressed) // found a selected note
4065+
{
4066+
if (!isSelection)
4067+
{
4068+
// drop other notes if we are realizing this is a selection now
4069+
isSelection = true;
4070+
nv.clear();
4071+
}
4072+
4073+
nv.push_back(i);
4074+
}
4075+
4076+
// not on selection - just push back the note if it is within range
4077+
if (!isSelection && i->withinRange(ticks_start, ticks_end))
40634078
{
40644079
nv.push_back(i);
40654080
}
40664081
}
4082+
40674083
if( nv.size() > 0 )
40684084
{
40694085
const int step = (we->angleDelta().y() > 0 ? 1 : -1) * (we->inverted() ? -1 : 1);

0 commit comments

Comments
 (0)