mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-18 18:02:37 +01:00
Codechange: Replace Rect CentreTo with CentreToHeight. (#14675)
So far all callers only need to centre vertically, so not having to provide the existing width simplifies calls.
This commit is contained in:
@@ -752,7 +752,7 @@ static inline void DrawButtonDropdown(const Rect &r, Colours colour, bool clicke
|
||||
Rect text = r.Indent(NWidgetLeaf::dropdown_dimension.width, !rtl);
|
||||
DrawFrameRect(text, colour, clicked_button ? FrameFlag::Lowered : FrameFlags{});
|
||||
if (!str.empty()) {
|
||||
text = text.CentreTo(text.Width(), GetCharacterHeight(FS_NORMAL)).Shrink(WidgetDimensions::scaled.dropdowntext, RectPadding::zero);
|
||||
text = text.CentreToHeight(GetCharacterHeight(FS_NORMAL)).Shrink(WidgetDimensions::scaled.dropdowntext, RectPadding::zero);
|
||||
DrawString(text, str, TC_BLACK, align);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user