From 2304506e854e64ab60a91f5d607654b10e6aab79 Mon Sep 17 00:00:00 2001 From: Timo Korvola Date: Sun, 4 Mar 2018 21:53:38 +0200 Subject: [PATCH] Fix os_string_width. Width was computed wrong for strings with more than one style or font change. --- src/sdl/sf_fonts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sdl/sf_fonts.c b/src/sdl/sf_fonts.c index f7bda1e..2a2a039 100644 --- a/src/sdl/sf_fonts.c +++ b/src/sdl/sf_fonts.c @@ -572,12 +572,12 @@ int os_string_width(const zchar *s) { if (c == ZC_NEW_STYLE) { - wacc = width+oh; width = 0; + wacc += oh; os_set_text_style(*s++); } else if (c == ZC_NEW_FONT) { - wacc = width+oh; width = 0; + wacc += oh; os_set_font(*s++); } else -- 2.34.1