summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2015-08-03 00:40:16 +0300
committerOleg Oshmyan <chortos@inbox.lv>2015-08-03 00:54:51 +0300
commit23de9995103c16ceceba19cae87e328be12fa8e4 (patch)
tree8ff2d885908cba40744adff326f0b9a0db9a399a /libass
parentdc78d6a0ce5a95a112b96d3b029172bb64d83252 (diff)
downloadlibass-23de9995103c16ceceba19cae87e328be12fa8e4.tar.bz2
libass-23de9995103c16ceceba19cae87e328be12fa8e4.tar.xz
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.
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_render.c2
1 files changed, 1 insertions, 1 deletions
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;