diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 6b8f9d7460..09265bbd5d 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -901,6 +901,9 @@ public: bool first = true; bool has_accept = false; + /* Use all the available space past the rect, so that we can enlarge the window if needed. */ + ir.bottom = INT_MAX; + if (i->prod_level == PRODLEVEL_CLOSURE) { DrawString(ir, STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE); ir.top += GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.vsep_wide; @@ -1008,10 +1011,7 @@ public: ir.top += WidgetDimensions::scaled.vsep_wide; StartTextRefStackUsage(ind->grf_prop.grffile, 6); - /* Use all the available space left from where we stand up to the - * end of the window. We ALSO enlarge the window if needed, so we - * can 'go' wild with the bottom of the window. */ - ir.top = DrawStringMultiLine(ir.left, ir.right, ir.top, UINT16_MAX, message, TC_BLACK); + ir.top = DrawStringMultiLine(ir, message, TC_BLACK); StopTextRefStackUsage(); } } @@ -1021,7 +1021,7 @@ public: if (!i->text.empty()) { SetDParamStr(0, i->text); ir.top += WidgetDimensions::scaled.vsep_wide; - ir.top = DrawStringMultiLine(ir.left, ir.right, ir.top, UINT16_MAX, STR_JUST_RAW_STRING, TC_BLACK); + ir.top = DrawStringMultiLine(ir, STR_JUST_RAW_STRING, TC_BLACK); } /* Return required bottom position, the last pixel row plus some padding. */ diff --git a/src/league_gui.cpp b/src/league_gui.cpp index 2f131dbdd4..b68970ed07 100644 --- a/src/league_gui.cpp +++ b/src/league_gui.cpp @@ -326,7 +326,7 @@ public: if (!lt->header.empty()) { SetDParamStr(0, lt->header); - ir.top = DrawStringMultiLine(ir.left, ir.right, ir.top, UINT16_MAX, STR_JUST_RAW_STRING, TC_BLACK) + WidgetDimensions::scaled.vsep_wide; + ir.top = DrawStringMultiLine(ir, STR_JUST_RAW_STRING, TC_BLACK) + WidgetDimensions::scaled.vsep_wide; } int icon_y_offset = (this->line_height - this->icon_size.height) / 2; @@ -354,7 +354,7 @@ public: if (!lt->footer.empty()) { ir.top += WidgetDimensions::scaled.vsep_wide; SetDParamStr(0, lt->footer); - ir.top = DrawStringMultiLine(ir.left, ir.right, ir.top, UINT16_MAX, STR_JUST_RAW_STRING, TC_BLACK); + ir.top = DrawStringMultiLine(ir, STR_JUST_RAW_STRING, TC_BLACK); } } diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 78f23766f0..cc3150ad08 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -234,6 +234,7 @@ public: Rect tr = r; const int bottom = tr.bottom; + /* Use all the available space past the rect, so that we can enlarge the window if needed. */ tr.bottom = INT16_MAX; tr.top = DrawBadgeNameList(tr, spec->badges, GSF_OBJECTS); @@ -247,9 +248,6 @@ public: StringID message = GetGRFStringID(spec->grf_prop.grfid, GRFSTR_MISC_GRF_TEXT + callback_res); if (message != STR_NULL && message != STR_UNDEFINED) { StartTextRefStackUsage(spec->grf_prop.grffile, 6); - /* Use all the available space left from where we stand up to the - * end of the window. We ALSO enlarge the window if needed, so we - * can 'go' wild with the bottom of the window. */ tr.top = DrawStringMultiLine(tr, message, TC_ORANGE); StopTextRefStackUsage(); } diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index eff33ed725..44c2e0c424 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -548,17 +548,17 @@ struct GameOptionsWindow : Window { switch (widget) { case WID_GO_BASE_GRF_DESCRIPTION: SetDParamStr(0, BaseGraphics::GetUsedSet()->GetDescription(GetCurrentLanguageIsoCode())); - DrawStringMultiLine(r.left, r.right, r.top, UINT16_MAX, STR_JUST_RAW_STRING, TC_BLACK); + DrawStringMultiLine(r, STR_JUST_RAW_STRING, TC_BLACK); break; case WID_GO_BASE_SFX_DESCRIPTION: SetDParamStr(0, BaseSounds::GetUsedSet()->GetDescription(GetCurrentLanguageIsoCode())); - DrawStringMultiLine(r.left, r.right, r.top, UINT16_MAX, STR_JUST_RAW_STRING, TC_BLACK); + DrawStringMultiLine(r, STR_JUST_RAW_STRING, TC_BLACK); break; case WID_GO_BASE_MUSIC_DESCRIPTION: SetDParamStr(0, BaseMusic::GetUsedSet()->GetDescription(GetCurrentLanguageIsoCode())); - DrawStringMultiLine(r.left, r.right, r.top, UINT16_MAX, STR_JUST_RAW_STRING, TC_BLACK); + DrawStringMultiLine(r, STR_JUST_RAW_STRING, TC_BLACK); break; case WID_GO_GUI_SCALE: