Fix: when syncing width of GUI items, take padding into account (#10915)

This commit is contained in:
Patric Stout
2023-06-05 10:27:04 +02:00
committed by Patric Stout
parent 4949bd8cd5
commit dea0f7e894
5 changed files with 19 additions and 17 deletions

View File

@@ -2003,7 +2003,7 @@ struct GameSettingsWindow : Window {
};
for (uint i = 0; i < lengthof(setting_types); i++) {
SetDParam(0, setting_types[i]);
size->width = std::max(size->width, GetStringBoundingBox(STR_CONFIG_SETTING_TYPE).width);
size->width = std::max(size->width, GetStringBoundingBox(STR_CONFIG_SETTING_TYPE).width + padding.width);
}
size->height = 2 * FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal +
std::max(size->height, GetSettingsTree().GetMaxHelpHeight(size->width));