From 85361ea254cc764c31bfcf6b4cc1fb90cda48a85 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Fri, 21 Dec 2007 11:56:23 +0000 Subject: Fixed shop list box not to scroll up when the selection is removed. --- ChangeLog | 5 +++++ src/gui/shoplistbox.cpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b0f88b31..bdcbbfab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-12-21 Bjørn Lindeijer + + * src/gui/shoplistbox.cpp: Fixed shop list box not to scroll up when + the selection is removed. + 2007-12-19 Philipp Sehmisch * data/maps/new_18-1.tmx: Fixed a map bug (monster trap) on diff --git a/src/gui/shoplistbox.cpp b/src/gui/shoplistbox.cpp index 610ad76c..4c590e66 100644 --- a/src/gui/shoplistbox.cpp +++ b/src/gui/shoplistbox.cpp @@ -114,10 +114,10 @@ void ShopListBox::setSelected(int selected) std::max(-1, selected)); gcn::Widget *parent = getParent(); - if (parent) + if (parent && mSelected >= 0) { gcn::Rectangle scroll; - scroll.y = (mSelected < 0) ? 0 : mRowHeight * mSelected; + scroll.y = mRowHeight * mSelected; scroll.height = mRowHeight; parent->showWidgetPart(this, scroll); } -- cgit v1.2.3-70-g09d2