mirror of
https://github.com/OpenTTD/OpenTTD
synced 2025-12-22 12:42:43 +01:00
Codechange: add and use GetString over directly accessing widget_data
This commit is contained in:
@@ -634,7 +634,7 @@ public:
|
||||
break;
|
||||
case WID_SL_SORT_BYNAME:
|
||||
case WID_SL_SORT_BYDATE: {
|
||||
Dimension d = GetStringBoundingBox(this->GetWidget<NWidgetCore>(widget)->widget_data);
|
||||
Dimension d = GetStringBoundingBox(this->GetWidget<NWidgetCore>(widget)->GetString());
|
||||
d.width += padding.width + Window::SortButtonWidth() * 2; // Doubled since the string is centred and it also looks better.
|
||||
d.height += padding.height;
|
||||
size = maxdim(size, d);
|
||||
|
||||
Reference in New Issue
Block a user