From 2f41c0411c270388efefb9bfa8dd7ecf1cf5b10b Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 24 Oct 2009 09:47:02 +0000 Subject: (svn r17850) -Codechange: remove most usage of delta on OnResize --- src/build_vehicle_gui.cpp | 5 +---- src/smallmap_gui.cpp | 2 +- src/station_gui.cpp | 2 +- src/vehicle_gui.cpp | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index a2af9cfe2..de2cea4e9 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1172,10 +1172,7 @@ struct BuildVehicleWindow : Window { virtual void OnResize(Point delta) { - if (delta.x != 0 && !this->listview_mode) { - ResizeButtons(this, BUILD_VEHICLE_WIDGET_BUILD, BUILD_VEHICLE_WIDGET_RENAME); - } - if (delta.y == 0) return; + if (!this->listview_mode) ResizeButtons(this, BUILD_VEHICLE_WIDGET_BUILD, BUILD_VEHICLE_WIDGET_RENAME); this->vscroll.SetCapacity((this->widget[BUILD_VEHICLE_WIDGET_LIST].bottom - this->widget[BUILD_VEHICLE_WIDGET_LIST].top + 1) / GetVehicleListHeight(this->vehicle_type)); this->widget[BUILD_VEHICLE_WIDGET_LIST].data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START); diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 5a5bf6c73..d1f3a4a3a 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1135,7 +1135,7 @@ public: virtual void OnResize(Point delta) { - if (delta.x != 0 && this->map_type == SMT_INDUSTRY) this->ResizeLegend(); + if (this->map_type == SMT_INDUSTRY) this->ResizeLegend(); } void SmallMapCenterOnCurrentPos() diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 1822c92b3..28118103e 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -1051,7 +1051,7 @@ struct StationViewWindow : public Window { virtual void OnResize(Point delta) { - if (delta.x != 0) ResizeButtons(this, SVW_LOCATION, SVW_RENAME); + ResizeButtons(this, SVW_LOCATION, SVW_RENAME); this->vscroll.SetCapacity((this->widget[SVW_WAITING].bottom - this->widget[SVW_WAITING].top + 1) / this->resize.step_height); } }; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index f2cb72cd5..5b258f5b4 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1498,8 +1498,7 @@ struct VehicleDetailsWindow : Window { virtual void OnResize(Point delta) { - if (delta.x != 0) ResizeButtons(this, VLD_WIDGET_DETAILS_CARGO_CARRIED, VLD_WIDGET_DETAILS_TOTAL_CARGO); - if (delta.y == 0) return; + ResizeButtons(this, VLD_WIDGET_DETAILS_CARGO_CARRIED, VLD_WIDGET_DETAILS_TOTAL_CARGO); this->vscroll.SetCapacity((this->widget[VLD_WIDGET_MIDDLE_DETAILS].bottom - this->widget[VLD_WIDGET_MIDDLE_DETAILS].top + 1) / 14); this->widget[VLD_WIDGET_MIDDLE_DETAILS].data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START); -- cgit v1.2.3-54-g00ecf