1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 08:52:40 +01:00

Fix: Mis-sized widgets due to missing widget fill. (#14370)

In most places where we calculate and set widget resize step we neglect
to set widget fill step to match. Initial widget sizing uses fill step
instead of resize step, which means the initial size may not be a
multiple of the resize step as intended. In particular this will cause
WWT_MATRIX to be misrendered.

Whether or not this matters depends on the widget type being resized and
the window layout, however for consistency always set fill step to the
same as resize step when calculating.
This commit is contained in:
Peter Nelson
2025-06-17 17:40:11 +01:00
committed by GitHub
parent 4144865c73
commit e4cf6ca0ba
28 changed files with 45 additions and 50 deletions

View File

@@ -430,8 +430,7 @@ public:
switch (widget) {
case WID_GL_LIST_GROUP:
size.width = this->ComputeGroupInfoSize();
resize.height = this->tiny_step_height;
fill.height = this->tiny_step_height;
fill.height = resize.height = this->tiny_step_height;
break;
case WID_GL_ALL_VEHICLES:
@@ -450,7 +449,7 @@ public:
case WID_GL_LIST_VEHICLE:
this->ComputeGroupInfoSize();
resize.height = GetVehicleListHeight(this->vli.vtype, this->tiny_step_height);
fill.height = resize.height = GetVehicleListHeight(this->vli.vtype, this->tiny_step_height);
size.height = 4 * resize.height;
break;