Fixed text alignment to be visible based rather than surface based

This commit is contained in:
2025-12-08 17:16:46 +02:00
parent 8e88adf1df
commit 9f8a037f69
3 changed files with 87 additions and 9 deletions

View File

@@ -66,8 +66,9 @@ TTF_Font* get_font(int size, const std::string& filename = default_font_name);
// Returns a rect to use during bliting of 2 surfaces
// base - surface on which the other is applied to
// applied - the surface which will be applied to the other
// hint - rect to hint visible area from applied - can be NULL
SDL_Rect surface_align(const SDL_Surface* base, const SDL_Surface* applied,
HorizontalAlign halign, VerticalAlign valign);
HorizontalAlign halign, VerticalAlign valign, const SDL_Rect* hint = nullptr);
// Reads the file and tries to parse a JSON file with comments
// cfg - output json struct