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

@@ -2227,7 +2227,7 @@ struct ScanProgressWindow : public Window {
SetDParamMaxDigits(1, 4);
/* We really don't know the width. We could determine it by scanning the NewGRFs,
* but this is the status window for scanning them... */
size->width = std::max<uint>(size->width, GetStringBoundingBox(STR_NEWGRF_SCAN_STATUS).width);
size->width = std::max<uint>(size->width, GetStringBoundingBox(STR_NEWGRF_SCAN_STATUS).width + padding.width);
size->height = FONT_HEIGHT_NORMAL * 2 + WidgetDimensions::scaled.vsep_normal;
break;
}