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. --- src/gui/shoplistbox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/shoplistbox.cpp') 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