From bf9f8ddf868f4bf7888e9df19c54be23da0f56b7 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Fri, 8 Nov 2024 14:06:07 +0700 Subject: [PATCH] fix middle alignment for patches with offsets (#1995) --- src/st_stuff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 004771d2..c3686d74 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1104,7 +1104,7 @@ static void DrawPatch(int x, int y, int maxheight, sbaralignment_t alignment, if (alignment & sbe_h_middle) { - x -= (width >> 1); + x = x - width / 2 + SHORT(patch->leftoffset); } else if (alignment & sbe_h_right) { @@ -1113,7 +1113,7 @@ static void DrawPatch(int x, int y, int maxheight, sbaralignment_t alignment, if (alignment & sbe_v_middle) { - y -= (height >> 1); + y = y - height / 2 + SHORT(patch->topoffset); } else if (alignment & sbe_v_bottom) {