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:
@@ -1163,7 +1163,7 @@ struct BaseCargoGraphWindow : BaseGraphWindow {
|
||||
this->line_height = size.height;
|
||||
size.height = this->line_height * 11; /* Default number of cargo types in most climates. */
|
||||
resize.width = 0;
|
||||
resize.height = this->line_height;
|
||||
fill.height = resize.height = this->line_height;
|
||||
}
|
||||
|
||||
void DrawWidget(const Rect &r, WidgetID widget) const override
|
||||
|
||||
Reference in New Issue
Block a user