diff options
author | rubidium <rubidium@openttd.org> | 2009-09-23 19:41:25 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-09-23 19:41:25 +0000 |
commit | 2d03e0af5d3ec32f905fedf1a780bad4ff058e83 (patch) | |
tree | 425fd4dece714fd150d74387f90a6c82b43a699f /src | |
parent | 244923a18df305c34aef8521d4779b9857ed5357 (diff) | |
download | openttd-2d03e0af5d3ec32f905fedf1a780bad4ff058e83.tar.xz |
(svn r17623) -Codechange: don't update the station's joiner scrollbar count in the drawing code
Diffstat (limited to 'src')
-rw-r--r-- | src/station_gui.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 01bff3a6c..aade14c44 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -1226,7 +1226,7 @@ struct SelectStationWindow : Window { this->vscroll.SetCapacity(6); this->resize.step_height = 10; - FindStationsNearby<T>(this->area, true); + this->OnInvalidateData(0); this->widget[JSW_WIDGET_CAPTION].data = T::EXPECTED_FACIL == FACIL_WAYPOINT ? STR_JOIN_WAYPOINT_CAPTION : STR_JOIN_STATION_CAPTION; this->FindWindowPlacementAndResize(desc); @@ -1234,8 +1234,6 @@ struct SelectStationWindow : Window { virtual void OnPaint() { - this->vscroll.SetCount(_stations_nearby_list.Length() + 1); - this->DrawWidgets(); uint y = 17; @@ -1286,12 +1284,13 @@ struct SelectStationWindow : Window { virtual void OnResize(Point delta) { - this->vscroll.UpdateCapacity((this->widget[JSW_PANEL].bottom - this->widget[JSW_PANEL].top) / 10); + this->vscroll.UpdateCapacity(delta.y / 10); } virtual void OnInvalidateData(int data) { FindStationsNearby<T>(this->area, true); + this->vscroll.SetCount(_stations_nearby_list.Length() + 1); this->SetDirty(); } }; |