From 33d2b71b013e6f08b94c1567e0ab8fb9c0fb94a6 Mon Sep 17 00:00:00 2001 From: Oskar Wallgren Date: Tue, 27 Feb 2018 15:59:15 +0100 Subject: [PATCH] Piano Roll - Erase on mouse button drag in erase mode (#4150) --- src/gui/editors/PianoRoll.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index ac9b0a891..c2ab9feff 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -2059,7 +2059,8 @@ void PianoRoll::mouseMoveEvent( QMouseEvent * me ) pauseTestNotes( false ); } } - else if( ( edit_note || m_action == ActionChangeNoteProperty ) && + else if( m_editMode != ModeErase && + ( edit_note || m_action == ActionChangeNoteProperty ) && ( me->buttons() & Qt::LeftButton || me->buttons() & Qt::MiddleButton || ( me->buttons() & Qt::RightButton && me->modifiers() & Qt::ShiftModifier ) ) ) { @@ -2254,9 +2255,11 @@ void PianoRoll::mouseMoveEvent( QMouseEvent * me ) --m_selectedKeys; } } - else if( m_editMode == ModeDraw && me->buttons() & Qt::RightButton ) + else if( ( m_editMode == ModeDraw && me->buttons() & Qt::RightButton ) + || ( m_editMode == ModeErase && me->buttons() ) ) { - // holding down right-click to delete notes + // holding down right-click to delete notes or holding down + // any key if in erase mode // get tick in which the user clicked int pos_ticks = x * MidiTime::ticksPerTact() / m_ppt +