mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-07-15 00:25:06 +01:00
(svn r18932) -Codechange: Don't constantly redraw drop drop list.
This commit is contained in:
parent
a3168269f9
commit
07b285c5ca
@ -260,9 +260,16 @@ struct DropdownWindow : Window {
|
||||
|
||||
virtual void OnTick()
|
||||
{
|
||||
this->vscroll.UpdatePosition(this->scrolling);
|
||||
this->scrolling = 0;
|
||||
this->SetDirty();
|
||||
if (this->scrolling != 0) {
|
||||
int pos = this->vscroll.GetPosition();
|
||||
|
||||
this->vscroll.UpdatePosition(this->scrolling);
|
||||
this->scrolling = 0;
|
||||
|
||||
if (pos != this->vscroll.GetPosition()) {
|
||||
this->SetDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnMouseLoop()
|
||||
@ -310,8 +317,10 @@ struct DropdownWindow : Window {
|
||||
if (!this->GetDropDownItem(item)) return;
|
||||
}
|
||||
|
||||
this->selected_index = item;
|
||||
this->SetDirty();
|
||||
if (this->selected_index != item) {
|
||||
this->selected_index = item;
|
||||
this->SetDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user