GUI: fix next/prev channel cursor out of bounds

issue #1597
This commit is contained in:
tildearrow 2023-11-26 18:23:57 -05:00
parent 7b2fa42d25
commit 4e333787ff

View file

@ -344,6 +344,10 @@ void FurnaceGUI::moveCursorPrevChannel(bool overflow) {
}
e->setMidiBaseChan(cursor.xCoarse);
int xFineMax=(e->curSubSong->chanCollapse[cursor.xCoarse]?(4-e->curSubSong->chanCollapse[cursor.xCoarse]):(3+e->curPat[cursor.xCoarse].effectCols*2));
if (cursor.xFine<0) cursor.xFine=0;
if (cursor.xFine>=xFineMax) cursor.xFine=xFineMax-1;
selStart=cursor;
selEnd=cursor;
demandScrollX=true;
@ -368,6 +372,10 @@ void FurnaceGUI::moveCursorNextChannel(bool overflow) {
}
e->setMidiBaseChan(cursor.xCoarse);
int xFineMax=(e->curSubSong->chanCollapse[cursor.xCoarse]?(4-e->curSubSong->chanCollapse[cursor.xCoarse]):(3+e->curPat[cursor.xCoarse].effectCols*2));
if (cursor.xFine<0) cursor.xFine=0;
if (cursor.xFine>=xFineMax) cursor.xFine=xFineMax-1;
selStart=cursor;
selEnd=cursor;
demandScrollX=true;