Codechange: refactor string list dimension finding into a separate function
This commit is contained in:
@@ -894,10 +894,7 @@ public:
|
||||
break;
|
||||
}
|
||||
case WID_TD_SORT_CRITERIA: {
|
||||
Dimension d = {0, 0};
|
||||
for (uint i = 0; TownDirectoryWindow::sorter_names[i] != INVALID_STRING_ID; i++) {
|
||||
d = maxdim(d, GetStringBoundingBox(TownDirectoryWindow::sorter_names[i]));
|
||||
}
|
||||
Dimension d = GetStringListBoundingBox(TownDirectoryWindow::sorter_names);
|
||||
d.width += padding.width;
|
||||
d.height += padding.height;
|
||||
size = maxdim(size, d);
|
||||
|
||||
Reference in New Issue
Block a user