PianoRoll: do not make notes disappear under certain circumstances

When starting LMMS, loading an existing project and opening a pattern
with notes inside in piano roll, moving single notes showed unexpected
behaviour, i.e. the according note has been moved somewhere unreachable.

I tracked this down to a missing initialization of m_moveBoundary*
variables. Adding a few lines fixes the issue (closes #2632909).
This commit is contained in:
Tobias Doerffel
2009-04-17 15:07:54 +02:00
parent d4680ba21d
commit efb335cea7

View File

@@ -151,6 +151,12 @@ pianoRoll::pianoRoll( void ) :
m_currentNote( NULL ),
m_action( ActionNone ),
m_noteEditMode( NoteEditVolume ),
m_moveBoundaryLeft( 0 ),
m_moveBoundaryTop( 0 ),
m_moveBoundaryRight( 0 ),
m_moveBoundaryBottom( 0 ),
m_mouseDownKey( 0 ),
m_mouseDownTick( 0 ),
m_lastMouseX( 0 ),
m_lastMouseY( 0 ),
m_oldNotesEditHeight( 100 ),
@@ -1490,6 +1496,10 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me )
{
clearSelectedNotes();
m_currentNote->setSelected( true );
m_moveBoundaryLeft = m_currentNote->pos().getTicks();
m_moveBoundaryRight = m_currentNote->pos() + m_currentNote->length();
m_moveBoundaryBottom = m_currentNote->key();
m_moveBoundaryTop = m_currentNote->key();
}