changeset 17075:7ac0e0454f5f draft

(svn r21812) -Fix (r21754): Don't try to scroll the matrix widget to position -1.
author alberth <alberth@openttd.org>
date Sat, 15 Jan 2011 19:54:53 +0000
parents e20de47424a0
children 37b1c0eebb05
files src/widget.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -1374,7 +1374,7 @@
 void NWidgetMatrix::SetClicked(int clicked)
 {
 	this->clicked = clicked;
-	if (this->sb != NULL && this->widgets_x != 0) {
+	if (this->clicked >= 0 && this->sb != NULL && this->widgets_x != 0) {
 		int vpos = (this->clicked / this->widgets_x) * this->widget_h; // Vertical position of the top.
 		/* Need to scroll down -> Scroll to the bottom.
 		 * However, last entry has no 'this->pip_inter' underneath, and we must stay below this->sb->GetCount() */