summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2009-08-14 01:34:31 +0200
committerGrigori Goronzy <greg@blackbox>2009-08-14 01:36:14 +0200
commit7b3dc7d1448f4c3f8ab0465b5ea8d1df55e7186b (patch)
treea88e0e9d9b19f12669ef37309e46a52a2e9ad464
parent9c4683bfa6b250e903557581fe6571159d595a46 (diff)
downloadlibass-7b3dc7d1448f4c3f8ab0465b5ea8d1df55e7186b.tar.bz2
libass-7b3dc7d1448f4c3f8ab0465b5ea8d1df55e7186b.tar.xz
Implement wrap style 1
Skip application of the algorithm that moves words between the lines to equalize line length for wrap style 1.
-rw-r--r--libass/ass_render.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 828c883..f0800c3 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -1625,13 +1625,12 @@ static unsigned get_next_char(ASS_Renderer *render_priv, char **str)
return ' ';
}
if (*p == '\\') {
- if ((*(p + 1) == 'N')
- || ((*(p + 1) == 'n')
- && (render_priv->state.wrap_style == 2))) {
+ if ((p[1] == 'N') || ((p[1] == 'n') &&
+ (render_priv->state.wrap_style == 2))) {
p += 2;
*str = p;
return '\n';
- } else if ((*(p + 1) == 'n') || (*(p + 1) == 'h')) {
+ } else if ((p[1] == 'n') || (p[1] == 'h')) {
p += 2;
*str = p;
return ' ';
@@ -2281,7 +2280,7 @@ wrap_lines_smart(ASS_Renderer *render_priv, double max_text_width)
}
#define DIFF(x,y) (((x) < (y)) ? (y - x) : (x - y))
exit = 0;
- while (!exit) {
+ while (!exit && render_priv->state.wrap_style != 1) {
exit = 1;
w = s3 = text_info->glyphs;
s1 = s2 = 0;