mirror of https://github.com/OpenTTD/OpenTTD
(svn r21812) -Fix (r21754): Don't try to scroll the matrix widget to position -1.
parent
89f245ab2f
commit
a1df4bea68
|
@ -1374,7 +1374,7 @@ void NWidgetMatrix::SetColour(Colours colour)
|
||||||
void NWidgetMatrix::SetClicked(int clicked)
|
void NWidgetMatrix::SetClicked(int clicked)
|
||||||
{
|
{
|
||||||
this->clicked = 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.
|
int vpos = (this->clicked / this->widgets_x) * this->widget_h; // Vertical position of the top.
|
||||||
/* Need to scroll down -> Scroll to the bottom.
|
/* 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() */
|
* However, last entry has no 'this->pip_inter' underneath, and we must stay below this->sb->GetCount() */
|
||||||
|
|
Loading…
Reference in New Issue