Codechange: add and use GetString over directly accessing widget_data

This commit is contained in:
Rubidium
2025-01-02 13:05:49 +01:00
committed by rubidium42
parent 56d4d3cc7a
commit 9ac1bad480
14 changed files with 42 additions and 31 deletions

View File

@@ -906,7 +906,7 @@ public:
{
switch (widget) {
case WID_TD_SORT_ORDER: {
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);