diff options
author | peter1138 <peter1138@openttd.org> | 2010-01-28 02:30:59 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2010-01-28 02:30:59 +0000 |
commit | 07b285c5ca3123050e55c78585ab0cbc051ce9e9 (patch) | |
tree | ce00a9a1378f4da666159b8d04eeb06a90d8f069 /src | |
parent | a3168269f9920e764669d7d63abff9ec5fe332d0 (diff) | |
download | openttd-07b285c5ca3123050e55c78585ab0cbc051ce9e9.tar.xz |
(svn r18932) -Codechange: Don't constantly redraw drop drop list.
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/dropdown.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 1056ebced..e32cf4151 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -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(); + } } } }; |