Codechange: refactor string list dimension finding into a separate function

This commit is contained in:
Rubidium
2024-04-28 15:59:53 +02:00
committed by rubidium42
parent 546a996d95
commit 37a03b513f
10 changed files with 26 additions and 35 deletions

View File

@@ -190,10 +190,7 @@ public:
break;
}
case WID_BBS_DROPDOWN_CRITERIA: {
Dimension d = {0, 0};
for (const StringID *str = BuildBridgeWindow::sorter_names; *str != INVALID_STRING_ID; str++) {
d = maxdim(d, GetStringBoundingBox(*str));
}
Dimension d = GetStringListBoundingBox(BuildBridgeWindow::sorter_names);
d.width += padding.width;
d.height += padding.height;
size = maxdim(size, d);