Skip to content

Commit

Permalink
Remove now unused m_oldNotesEditHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
Veratil committed Apr 12, 2020
1 parent 648cf2a commit 90c428b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
1 change: 0 additions & 1 deletion include/PianoRoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ protected slots:
int m_moveStartX;
int m_moveStartY;

int m_oldNotesEditHeight;
int m_notesEditHeight;
int m_ppb; // pixels per bar
int m_totalKeysToScroll;
Expand Down
15 changes: 1 addition & 14 deletions src/gui/editors/PianoRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ PianoRoll::PianoRoll() :
m_mouseDownTick( 0 ),
m_lastMouseX( 0 ),
m_lastMouseY( 0 ),
m_oldNotesEditHeight( 100 ),
m_notesEditHeight( 100 ),
m_ppb( DEFAULT_PR_PPB ),
m_lenOfNewNotes( MidiTime( 0, DefaultTicksPerBar/4 ) ),
Expand Down Expand Up @@ -1558,7 +1557,6 @@ void PianoRoll::mousePressEvent(QMouseEvent * me )
{
// resizing the note edit area
m_action = ActionResizeNoteEditArea;
m_oldNotesEditHeight = m_notesEditHeight;
return;
}

Expand Down Expand Up @@ -2175,11 +2173,6 @@ void PianoRoll::mouseReleaseEvent( QMouseEvent * me )
clearSelectedNotes();
}
}

if (m_action == ActionResizeNoteEditArea)
{
m_oldNotesEditHeight = m_notesEditHeight;
}
}

if( me->button() & Qt::RightButton )
Expand Down Expand Up @@ -2877,11 +2870,6 @@ void PianoRoll::paintEvent(QPaintEvent * pe )
if (hasValidPattern())
{
int pianoArea, partialKeyVisible, topKey, topNote;
// if resizing the note edit area, don't touch m_oldNotesEditHeight
if (m_action != ActionResizeNoteEditArea)
{
m_notesEditHeight = m_oldNotesEditHeight;
}
pianoArea = keyAreaBottom() - keyAreaTop();
m_pianoKeysVisible = pianoArea / KEY_LINE_HEIGHT;
partialKeyVisible = pianoArea % KEY_LINE_HEIGHT;
Expand All @@ -2895,10 +2883,9 @@ void PianoRoll::paintEvent(QPaintEvent * pe )
}
topKey = qBound(0, m_startKey + m_pianoKeysVisible - 1, NumKeys - 1);
topNote = topKey % KeysPerOctave;
// if resizing the note edit area, don't touch m_oldNotesEditHeight
// if resizing the note edit area
if (m_action != ActionResizeNoteEditArea && partialKeyVisible != 0)
{
m_oldNotesEditHeight = m_notesEditHeight;
// adding height always means we don't have to add keys
m_notesEditHeight += partialKeyVisible;
}
Expand Down

0 comments on commit 90c428b

Please sign in to comment.