From: Grigori Goronzy Date: Sun, 19 Jul 2009 03:44:06 +0000 (+0200) Subject: Fix vertical centering (VALIGN_CENTER) X-Git-Tag: 0.9.7~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7690af4af50fda163ed724e8d0f3ce5d9a9ec552;p=libass Fix vertical centering (VALIGN_CENTER) 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. --- diff --git a/libass/ass_render.c b/libass/ass_render.c index e79c6b8..5caf8eb 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -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)