diff options
author | Eugene Sandulenko | 2004-10-06 22:19:49 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2004-10-06 22:19:49 +0000 |
commit | 7b16b16e202c23bf4ea2ae28bca99a09ff292304 (patch) | |
tree | 519f1501e9c03048e58e0f277139e2535d64cc9d /gui | |
parent | bb2417d9afa061a0eb5cf5ecf851672240a4d6cf (diff) | |
download | scummvm-rg350-7b16b16e202c23bf4ea2ae28bca99a09ff292304.tar.gz scummvm-rg350-7b16b16e202c23bf4ea2ae28bca99a09ff292304.tar.bz2 scummvm-rg350-7b16b16e202c23bf4ea2ae28bca99a09ff292304.zip |
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
Diffstat (limited to 'gui')
-rw-r--r-- | gui/ListWidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp index b1efd5a38d..8d4d7df21e 100644 --- a/gui/ListWidget.cpp +++ b/gui/ListWidget.cpp @@ -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; |