mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-18 09:52:44 +01:00
Codechange: pass options to ShowDropDownMenu using a span
This commit is contained in:
@@ -868,10 +868,10 @@ Dimension GetStringBoundingBox(StringID strid, FontSize start_fontsize)
|
||||
* @param fontsize Font size to use.
|
||||
* @return Width of longest string within the list.
|
||||
*/
|
||||
uint GetStringListWidth(const StringID *list, FontSize fontsize)
|
||||
uint GetStringListWidth(std::span<const StringID> list, FontSize fontsize)
|
||||
{
|
||||
uint width = 0;
|
||||
for (const StringID *str = list; *str != INVALID_STRING_ID; str++) {
|
||||
for (const StringID *str = list.data(); *str != INVALID_STRING_ID; str++) {
|
||||
width = std::max(width, GetStringBoundingBox(*str, fontsize).width);
|
||||
}
|
||||
return width;
|
||||
|
||||
Reference in New Issue
Block a user