Fix menu layout in bordered/SGB mode, in the SDL port

This commit is contained in:
Lior Halphon 2024-01-06 17:46:12 +02:00
parent 927b7493e5
commit 226825bda4
1 changed files with 2 additions and 2 deletions

View File

@ -238,12 +238,12 @@ enum style {
static void draw_styled_text(uint32_t *buffer, unsigned width, unsigned height, unsigned y, const char *string, uint32_t color, uint32_t border, enum style style)
{
unsigned x = GLYPH_WIDTH * 2;
unsigned x = GLYPH_WIDTH * 2 + (width - 160) / 2;
if (style == STYLE_CENTER || style == STYLE_ARROWS) {
x = width / 2 - (unsigned) strlen(string) * GLYPH_WIDTH / 2;
}
else if (style == STYLE_LEFT) {
x = 6;
x = 6 + (width - 160) / 2;
}
draw_text(buffer, width, height, x, y, string, color, border, false);