From: Oleg Oshmyan Date: Sun, 2 Aug 2015 21:40:16 +0000 (+0300) Subject: Properly skip glyphs for multiple consecutive line breaks X-Git-Tag: 0.13.0~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23de9995103c16ceceba19cae87e328be12fa8e4;p=libass Properly skip glyphs for multiple consecutive line breaks This corrects the calculated width of events that contain \N\N, which previously included the width of the glyph corresponding to '\n' (more generally, for n consecutive line breaks, only the first glyph was skipped and n-1 glyphs were included). Reported on IRC. --- diff --git a/libass/ass_render.c b/libass/ass_render.c index 42758c8..3fc4daf 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1481,7 +1481,7 @@ static void trim_whitespace(ASS_Renderer *render_priv) } // A break itself can contain a whitespace, too cur = ti->glyphs + i; - if (cur->symbol == ' ') { + if (cur->symbol == ' ' || cur->symbol == '\n') { cur->skip++; // Mark whitespace after j = i + 1;