From 6f397e048c2df5cea55632a034f86fa7da9cd269 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 5 Dec 2008 08:25:55 +0000 Subject: [PATCH] fixed bug where it thought every modifier was the alt key corrected quantization when dragging a note while scrolling with arrow keys git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1872 0778d3d1-df1d-0410-868b-ea421aaaa00d --- src/gui/piano_roll.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 ) {