mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-03 08:40:59 +00:00
Fix bug reported by salty-horse. When list is so short so it fits
one page, list position gets negative values. This never was triggered until lastselectedgame config file key was introduced. svn-id: r15441
This commit is contained in:
parent
bb2417d9af
commit
7b16b16e20
@ -399,7 +399,7 @@ void ListWidget::scrollToCurrent() {
|
||||
_currentPos = _selectedItem - _entriesPerPage + 1;
|
||||
}
|
||||
|
||||
if (_currentPos < 0)
|
||||
if (_currentPos < 0 || _entriesPerPage > (int)_list.size())
|
||||
_currentPos = 0;
|
||||
else if (_currentPos + _entriesPerPage > (int)_list.size())
|
||||
_currentPos = _list.size() - _entriesPerPage;
|
||||
|
Loading…
x
Reference in New Issue
Block a user