summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-10-17 14:29:10 +0000
committerrubidium <rubidium@openttd.org>2009-10-17 14:29:10 +0000
commitd1d35b95b6e75a263b9395125af7d22faf02f462 (patch)
treedaed0a809413d71060da91af4c67175989222a2e /src/vehicle_gui.cpp
parent22ddb90fdbc45087064816ddb0cf0e0a27786db1 (diff)
downloadopenttd-d1d35b95b6e75a263b9395125af7d22faf02f462.tar.xz
(svn r17786) -Fix [FS#3265]: graphical glitches (matrices/scrollbars with wrong 'size') upon reiniting windows
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r--src/vehicle_gui.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 4af37ff2c..f2cb72cd5 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -389,7 +389,7 @@ struct RefitWindow : public Window {
virtual void OnResize(Point delta)
{
- this->vscroll.UpdateCapacity(delta.y / (int)this->resize.step_height);
+ this->vscroll.SetCapacity((this->widget[VRW_MATRIX].bottom - this->widget[VRW_MATRIX].top + 1) / this->resize.step_height);
this->widget[VRW_MATRIX].data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
}
};
@@ -1105,7 +1105,7 @@ struct VehicleListWindow : public BaseVehicleListWindow {
virtual void OnResize(Point delta)
{
- this->vscroll.UpdateCapacity(delta.y / (int)this->resize.step_height);
+ this->vscroll.SetCapacity((this->widget[VLW_WIDGET_LIST].bottom - this->widget[VLW_WIDGET_LIST].top + 1) / this->resize.step_height);
this->widget[VLW_WIDGET_LIST].data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
}
@@ -1501,7 +1501,7 @@ struct VehicleDetailsWindow : Window {
if (delta.x != 0) ResizeButtons(this, VLD_WIDGET_DETAILS_CARGO_CARRIED, VLD_WIDGET_DETAILS_TOTAL_CARGO);
if (delta.y == 0) return;
- this->vscroll.UpdateCapacity(delta.y / 14);
+ 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);
}
};