Codechange: Remove FONT_HEIGHT_... macros. (#11481)

These make it look like we're dealing with a constant, but actually each is a call to `GetCharacterHeight(...)`.
This commit is contained in:
Peter Nelson
2023-11-21 19:04:24 +00:00
committed by GitHub
parent 96ec9c1b47
commit c18a1494b7
57 changed files with 369 additions and 381 deletions

View File

@@ -197,7 +197,7 @@ struct SignListWindow : Window, SignList {
switch (widget) {
case WID_SIL_LIST: {
Rect tr = r.Shrink(WidgetDimensions::scaled.framerect);
uint text_offset_y = (this->resize.step_height - FONT_HEIGHT_NORMAL + 1) / 2;
uint text_offset_y = (this->resize.step_height - GetCharacterHeight(FS_NORMAL) + 1) / 2;
/* No signs? */
if (this->vscroll->GetCount() == 0) {
DrawString(tr.left, tr.right, tr.top + text_offset_y, STR_STATION_LIST_NONE);
@@ -269,7 +269,7 @@ struct SignListWindow : Window, SignList {
case WID_SIL_LIST: {
Dimension spr_dim = GetSpriteSize(SPR_COMPANY_ICON);
this->text_offset = WidgetDimensions::scaled.frametext.left + spr_dim.width + 2; // 2 pixels space between icon and the sign text.
resize->height = std::max<uint>(FONT_HEIGHT_NORMAL, spr_dim.height + 2);
resize->height = std::max<uint>(GetCharacterHeight(FS_NORMAL), spr_dim.height + 2);
Dimension d = {(uint)(this->text_offset + WidgetDimensions::scaled.frametext.right), padding.height + 5 * resize->height};
*size = maxdim(*size, d);
break;