diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index 112bf6b4a..356b09456 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -1612,7 +1612,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) && m_editMode == ModeDraw && (m_action == ActionMoveNote || m_action == ActionResizeNote ) ) { - dragNotes(_me->x(), _me->y(), _me->modifiers() && Qt::AltModifier); + dragNotes(_me->x(), _me->y(), _me->modifiers() & Qt::AltModifier); } else if( ( edit_note == true || m_action == ActionChangeNoteVolume ) && _me->buttons() & Qt::LeftButton ) @@ -2026,6 +2026,11 @@ void pianoRoll::dragNotes( int x, int y, bool alt ) int off_ticks = off_x * midiTime::ticksPerTact() / m_ppt; int off_key = getKey( y ) - getKey( m_moveStartY ); + // handle scroll changes while dragging + off_ticks -= m_mouseDownTick - m_currentPosition; + off_key -= m_mouseDownKey - m_startKey; + + // if they're not holding alt, quantize the offset if( ! alt ) { @@ -2033,10 +2038,6 @@ void pianoRoll::dragNotes( int x, int y, bool alt ) * quantization(); } - // handle scroll changes while dragging - off_ticks -= m_mouseDownTick - m_currentPosition; - off_key -= m_mouseDownKey - m_startKey; - // make sure notes won't go outside boundary conditions if( m_action == ActionMoveNote ) {