diff --git a/include/PianoRoll.h b/include/PianoRoll.h index 9167804ae43..125ed56d9cc 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -250,6 +250,7 @@ protected slots: QList m_markedSemiTones; QMenu * m_semiToneMarkerMenu; // when you right click on the key area + int m_pianoKeySelected; PianoRoll(); PianoRoll( const PianoRoll & ); diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index d6dec21ee46..358be5ab547 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -507,7 +507,7 @@ void PianoRoll::changeNoteEditMode( int i ) void PianoRoll::markSemiTone( int i ) { - const int key = getKey( mapFromGlobal( m_semiToneMarkerMenu->pos() ).y() ); + const int key = m_pianoKeySelected; const InstrumentFunctionNoteStacking::Chord * chord = nullptr; switch( static_cast( i ) ) @@ -1704,6 +1704,7 @@ void PianoRoll::mousePressEvent(QMouseEvent * me ) if( me->buttons() == Qt::RightButton ) { // right click, tone marker contextual menu + m_pianoKeySelected = getKey( me->y() ); m_semiToneMarkerMenu->popup( mapToGlobal( QPoint( me->x(), me->y() ) ) ); } else