]> granicus.if.org Git - libass/commitdiff
Only word wrap on spaces
authorGrigori Goronzy <greg@blackbox>
Thu, 12 Aug 2010 19:47:24 +0000 (21:47 +0200)
committerGrigori Goronzy <greg@blackbox>
Thu, 12 Aug 2010 19:47:24 +0000 (21:47 +0200)
It looks like VSFilter only ever wraps on spaces, even if the line
length is going to overflow. We should do that as well.
Fixes a pretty confusing problem with scrolling vertical text.

libass/ass_render.c

index c9607769c8abd9316e5a1bcfcf4efbe32162158f..2fade830b1211f3a0569df7bcc02271f7e55e8af 100644 (file)
@@ -1454,13 +1454,9 @@ wrap_lines_smart(ASS_Renderer *render_priv, double max_text_width)
             && (render_priv->state.wrap_style != 2)) {
             break_type = 1;
             break_at = last_space;
-            if (break_at == -1)
-                break_at = i - 1;
-            if (break_at == -1)
-                break_at = 0;
-            ass_msg(render_priv->library, MSGL_DBG2, "overfill at %d", i);
-            ass_msg(render_priv->library, MSGL_DBG2, "line break at %d",
-                    break_at);
+            if (break_at >= 0)
+                ass_msg(render_priv->library, MSGL_DBG2, "line break at %d",
+                        break_at);
         }
 
         if (break_at != -1) {