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 GitHub
parent 15c75e6f45
commit 772729cc7d
5 changed files with 19 additions and 17 deletions

View File

@@ -2123,7 +2123,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));