Fix os_string_width.
authorTimo Korvola <tkorvola@iki.fi>
Sun, 4 Mar 2018 19:53:38 +0000 (21:53 +0200)
committerDavid Griffith <dave@661.org>
Sun, 11 Mar 2018 11:48:50 +0000 (04:48 -0700)
Width was computed wrong for strings with more than one style or font
change.

src/sdl/sf_fonts.c

index f7bda1e11d36a25c98eafada44b4b7217b512415..2a2a0398b2b6c40e74e8464f066bf5b93a270bcc 100644 (file)
@@ -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