Fixed a GridComponent navigation issue when there was only a single column.

This commit is contained in:
Leon Styhre 2022-12-10 20:36:52 +01:00
parent 23438cd101
commit 7ba596775d

View file

@ -339,14 +339,14 @@ protected:
bool doScroll {true};
// This is only needed for GridComponent.
if (mColumns != 0 && mScrollVelocity == -mColumns && mCursor < mColumns) {
if (mColumns > 1 && mScrollVelocity == -mColumns && mCursor < mColumns) {
doScroll = false;
}
else if (mColumns != 0 && mScrollVelocity == mColumns) {
if (size() - mCursor <= size() % mColumns)
doScroll = false;
else if (mCursor >= (mColumns * mRows) - mColumns && size() - mCursor <= mColumns &&
size() % mColumns == 0)
else if (mColumns != 1 && mCursor >= (mColumns * mRows) - mColumns &&
size() - mCursor <= mColumns && size() % mColumns == 0)
doScroll = false;
else if (size() < mColumns)
doScroll = false;