summaryrefslogtreecommitdiff
path: root/src/gui/shoplistbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/shoplistbox.cpp')
-rw-r--r--src/gui/shoplistbox.cpp4
1 files changed, 2 insertions, 2 deletions
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);
}