summaryrefslogtreecommitdiff
path: root/src/station_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/station_gui.cpp')
-rw-r--r--src/station_gui.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index 01e1caa63..3ab59320a 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -566,7 +566,7 @@ public:
virtual void OnResize(Point delta)
{
- this->vscroll.UpdateCapacity(delta.y / 10);
+ this->vscroll.SetCapacity((this->widget[SLW_LIST].bottom - this->widget[SLW_LIST].top + 1) / 10);
}
virtual void OnInvalidateData(int data)
@@ -1052,7 +1052,7 @@ struct StationViewWindow : public Window {
virtual void OnResize(Point delta)
{
if (delta.x != 0) ResizeButtons(this, SVW_LOCATION, SVW_RENAME);
- this->vscroll.UpdateCapacity(delta.y / (int)this->resize.step_height);
+ this->vscroll.SetCapacity((this->widget[SVW_WAITING].bottom - this->widget[SVW_WAITING].top + 1) / this->resize.step_height);
}
};
@@ -1296,7 +1296,7 @@ struct SelectStationWindow : Window {
virtual void OnResize(Point delta)
{
- this->vscroll.UpdateCapacity(delta.y / (int)this->resize.step_height);
+ this->vscroll.SetCapacity((this->GetWidget<NWidgetBase>(JSW_PANEL)->current_y - WD_FRAMERECT_TOP - WD_FRAMERECT_BOTTOM) / this->resize.step_height);
}
virtual void OnInvalidateData(int data)