]> granicus.if.org Git - libass/commitdiff
Fix vertical centering (VALIGN_CENTER)
authorGrigori Goronzy <greg@blackbox>
Sun, 19 Jul 2009 03:44:06 +0000 (05:44 +0200)
committerGrigori Goronzy <greg@blackbox>
Sun, 19 Jul 2009 13:56:11 +0000 (15:56 +0200)
Match VSFilter behavior when centering non-positioned events
vertically.  Previously, libass put the event on top of the vertical
center while VSFilter centered the event evenly.  Adjust the centering
to behave like VSFilter.

libass/ass_render.c

index e79c6b8c4fb9ab04c1fb5b52be69b8f0fac3ab33..5caf8ebfe1dda7ee9b8e45fffa88894a92d1535c 100644 (file)
@@ -2974,7 +2974,7 @@ ass_render_event(ass_renderer_t *render_priv, ass_event_t *event,
         } else if (valign == VALIGN_CENTER) {   // midtitle
             double scr_y =
                 y2scr(render_priv, render_priv->track->PlayResY / 2.0);
-            device_y = scr_y - (bbox.yMax - bbox.yMin) / 2.0;
+            device_y = scr_y - (bbox.yMax + bbox.yMin) / 2.0;
         } else {                // subtitle
             double scr_y;
             if (valign != VALIGN_SUB)