From bd097e377089b3c7e8ae0c6f10495003b76519e6 Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Sat, 17 Oct 2020 01:24:05 +0300 Subject: Fix Scroll effect coordinates The coordinate computed for the text's top edge was actually used for the baseline of the text's top line, causing the first line's ascender to protrude up and the whole text to be shifted up by that ascender. (Note: in this context, bbox.y_min == text_info->lines[0].asc.) --- libass/ass_render.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index b4051539..272a1e85 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -2689,12 +2689,13 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event, y2scr(render_priv, render_priv->state.clip_y0 + render_priv->state.scroll_shift) - - (bbox.y_max - bbox.y_min); + bbox.y_max; else if (render_priv->state.scroll_direction == SCROLL_BT) device_y = y2scr(render_priv, render_priv->state.clip_y1 - - render_priv->state.scroll_shift); + render_priv->state.scroll_shift) - + bbox.y_min; } else if (!(render_priv->state.evt_type & EVENT_POSITIONED)) { if (valign == VALIGN_TOP) { // toptitle device_y = -- cgit v1.2.3