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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user