mirror of
https://github.com/LMMS/lmms.git
synced 2026-03-04 06:07:15 -05:00
Added check for empty notes vector in shiftPos (#6252)
This commit is contained in:
@@ -1222,6 +1222,11 @@ void PianoRoll::shiftPos(int amount) //Shift notes pos by amount
|
||||
void PianoRoll::shiftPos(NoteVector notes, int amount)
|
||||
{
|
||||
m_pattern->addJournalCheckPoint();
|
||||
|
||||
if (notes.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto leftMostPos = notes.first()->pos();
|
||||
//Limit leftwards shifts to prevent moving left of pattern start
|
||||
auto shiftAmount = (leftMostPos > -amount) ? amount : -leftMostPos;
|
||||
|
||||
Reference in New Issue
Block a user