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:
@@ -647,7 +647,7 @@ static int DrawLayoutLine(const ParagraphLayouter::Line &line, int y, int left,
|
||||
int DrawString(int left, int right, int top, std::string_view str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
|
||||
{
|
||||
/* The string may contain control chars to change the font, just use the biggest font for clipping. */
|
||||
int max_height = std::max({FONT_HEIGHT_SMALL, FONT_HEIGHT_NORMAL, FONT_HEIGHT_LARGE, FONT_HEIGHT_MONO});
|
||||
int max_height = std::max({GetCharacterHeight(FS_SMALL), GetCharacterHeight(FS_NORMAL), GetCharacterHeight(FS_LARGE), GetCharacterHeight(FS_MONO)});
|
||||
|
||||
/* Funny glyphs may extent outside the usual bounds, so relax the clipping somewhat. */
|
||||
int extra = max_height / 2;
|
||||
@@ -915,7 +915,7 @@ void DrawCharCentered(char32_t c, const Rect &r, TextColour colour)
|
||||
SetColourRemap(colour);
|
||||
GfxMainBlitter(GetGlyph(FS_NORMAL, c),
|
||||
CenterBounds(r.left, r.right, GetCharacterWidth(FS_NORMAL, c)),
|
||||
CenterBounds(r.top, r.bottom, FONT_HEIGHT_NORMAL),
|
||||
CenterBounds(r.top, r.bottom, GetCharacterHeight(FS_NORMAL)),
|
||||
BM_COLOUR_REMAP);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user