aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorEugene Sandulenko2004-10-06 22:19:49 +0000
committerEugene Sandulenko2004-10-06 22:19:49 +0000
commit7b16b16e202c23bf4ea2ae28bca99a09ff292304 (patch)
tree519f1501e9c03048e58e0f277139e2535d64cc9d /gui
parentbb2417d9afa061a0eb5cf5ecf851672240a4d6cf (diff)
downloadscummvm-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.cpp2
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;