From eb5552057e4b6d584a256c783c4a10a379f28537 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Tue, 12 Sep 2023 17:25:08 +0200 Subject: [PATCH] fix right-aligned hud widgets partially drawn off-screen Fixes #1201, thanks @liPillON --- src/hu_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hu_lib.c b/src/hu_lib.c index 3be2d3a5..79ba9ae5 100644 --- a/src/hu_lib.c +++ b/src/hu_lib.c @@ -32,7 +32,7 @@ int hud_widescreen_widgets; void HUlib_set_margins (void) { left_margin = HU_GAPX; - max_width = SCREENWIDTH - WIDESCREENDELTA - 2 * HU_GAPX; + max_width = SCREENWIDTH - WIDESCREENDELTA - HU_GAPX; if (hud_widescreen_widgets) { @@ -336,7 +336,7 @@ static void draw_line_aligned (const hu_multiline_t *m, const hu_line_t *l, cons { int w = SHORT(p[c-HU_FONTSTART]->width); - if (x+w >= max_width) + if (x+w > max_width) break; // killough 1/18/98 -- support multiple lines: