1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 09:29:10 +00:00

Cleanup: Let GetStringBoundingBox deal with buffer.

This commit is contained in:
2023-04-12 12:21:07 +01:00
committed by PeterN
parent 701092003d
commit 5bc9d00735

View File

@@ -33,9 +33,7 @@ void DropDownListItem::Draw(const Rect &r, bool sel, Colours bg_colour) const
uint DropDownListStringItem::Width() const
{
char buffer[512];
GetString(buffer, this->String(), lastof(buffer));
return GetStringBoundingBox(buffer).width + WidgetDimensions::scaled.dropdowntext.Horizontal();
return GetStringBoundingBox(this->String()).width + WidgetDimensions::scaled.dropdowntext.Horizontal();
}
void DropDownListStringItem::Draw(const Rect &r, bool sel, Colours bg_colour) const