mirror of https://github.com/OpenTTD/OpenTTD
Cleanup: Let GetStringBoundingBox deal with buffer.
parent
701092003d
commit
5bc9d00735
|
@ -33,9 +33,7 @@ void DropDownListItem::Draw(const Rect &r, bool sel, Colours bg_colour) const
|
||||||
|
|
||||||
uint DropDownListStringItem::Width() const
|
uint DropDownListStringItem::Width() const
|
||||||
{
|
{
|
||||||
char buffer[512];
|
return GetStringBoundingBox(this->String()).width + WidgetDimensions::scaled.dropdowntext.Horizontal();
|
||||||
GetString(buffer, this->String(), lastof(buffer));
|
|
||||||
return GetStringBoundingBox(buffer).width + WidgetDimensions::scaled.dropdowntext.Horizontal();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DropDownListStringItem::Draw(const Rect &r, bool sel, Colours bg_colour) const
|
void DropDownListStringItem::Draw(const Rect &r, bool sel, Colours bg_colour) const
|
||||||
|
|
Loading…
Reference in New Issue