1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-21 05:29:11 +00:00

Fix #8250: [NRT] Company infrastructure window always omits last road/tramtype

This commit is contained in:
stormcone
2020-07-02 12:35:28 +02:00
committed by Charles Pigott
parent 536184e21f
commit cb5a1300ac

View File

@@ -1884,7 +1884,7 @@ struct CompanyInfrastructureWindow : Window
switch (widget) { switch (widget) {
case WID_CI_RAIL_DESC: { case WID_CI_RAIL_DESC: {
uint lines = 1; uint lines = 1; // Starts at 1 because a line is also required for the section title
size->width = max(size->width, GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_RAIL_SECT).width); size->width = max(size->width, GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_RAIL_SECT).width);
@@ -1907,7 +1907,7 @@ struct CompanyInfrastructureWindow : Window
case WID_CI_ROAD_DESC: case WID_CI_ROAD_DESC:
case WID_CI_TRAM_DESC: { case WID_CI_TRAM_DESC: {
uint lines = 0; uint lines = 1; // Starts at 1 because a line is also required for the section title
size->width = max(size->width, GetStringBoundingBox(widget == WID_CI_ROAD_DESC ? STR_COMPANY_INFRASTRUCTURE_VIEW_ROAD_SECT : STR_COMPANY_INFRASTRUCTURE_VIEW_TRAM_SECT).width); size->width = max(size->width, GetStringBoundingBox(widget == WID_CI_ROAD_DESC ? STR_COMPANY_INFRASTRUCTURE_VIEW_ROAD_SECT : STR_COMPANY_INFRASTRUCTURE_VIEW_TRAM_SECT).width);