diff options
author | alberth <alberth@openttd.org> | 2011-01-15 19:54:53 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2011-01-15 19:54:53 +0000 |
commit | a1df4bea6829c1785e8122c3adc915fa3c09964c (patch) | |
tree | f1c8b2c9f1791141a9aa7b138f09e2f91ef0534b /src | |
parent | 89f245ab2f08d50383b2cb58d955a9c78d70bcfd (diff) | |
download | openttd-a1df4bea6829c1785e8122c3adc915fa3c09964c.tar.xz |
(svn r21812) -Fix (r21754): Don't try to scroll the matrix widget to position -1.
Diffstat (limited to 'src')
-rw-r--r-- | src/widget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widget.cpp b/src/widget.cpp index 84fdadbb8..44bdb91d8 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -1374,7 +1374,7 @@ void NWidgetMatrix::SetColour(Colours colour) 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() */ |