From 226825bda4bd344b6ccc7ee4794c8d707d25c106 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 6 Jan 2024 17:46:12 +0200 Subject: [PATCH] Fix menu layout in bordered/SGB mode, in the SDL port --- SDL/gui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SDL/gui.c b/SDL/gui.c index 77a08da..ad9efae 100644 --- a/SDL/gui.c +++ b/SDL/gui.c @@ -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);