summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2014-01-15 01:07:26 +0000
committerOleg Oshmyan <chortos@inbox.lv>2014-01-15 03:42:42 +0000
commitf6211a334e238483ba1da05e5879e3c54e93f401 (patch)
treeaa14bcfa58484231399c9c877d0a663869cebae1
parentb08d329ba8addd09b20d39d9f75c44e754453a98 (diff)
downloadlibass-f6211a334e238483ba1da05e5879e3c54e93f401.tar.bz2
libass-f6211a334e238483ba1da05e5879e3c54e93f401.tar.xz
Don't ignore trailing empty line
Trailing \N is effectively ignored, but \N\N should still yield an empty line.
-rw-r--r--libass/ass_render.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 1edb9ae..ca89e76 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -1361,7 +1361,7 @@ static void measure_text(ASS_Renderer *render_priv)
text_info->height = 0.;
for (i = 0; i < text_info->length + 1; ++i) {
if ((i == text_info->length) || text_info->glyphs[i].linebreak) {
- if (empty_line && cur_line > 0 && last && i < text_info->length) {
+ if (empty_line && cur_line > 0 && last) {
max_asc = d6_to_double(last->asc) / 2.0;
max_desc = d6_to_double(last->desc) / 2.0;
}
@@ -1371,16 +1371,17 @@ static void measure_text(ASS_Renderer *render_priv)
cur_line++;
max_asc = max_desc = 0.;
empty_line = 1;
- } else
- empty_line = 0;
+ }
if (i < text_info->length) {
GlyphInfo *cur = text_info->glyphs + i;
if (d6_to_double(cur->asc) > max_asc)
max_asc = d6_to_double(cur->asc);
if (d6_to_double(cur->desc) > max_desc)
max_desc = d6_to_double(cur->desc);
- if (cur->symbol != '\n' && cur->symbol != 0)
+ if (cur->symbol != '\n' && cur->symbol != 0) {
+ empty_line = 0;
last = cur;
+ }
}
}
text_info->height +=