summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2020-10-17 01:24:05 +0300
committerOleg Oshmyan <chortos@inbox.lv>2020-10-18 05:03:17 +0300
commitbd097e377089b3c7e8ae0c6f10495003b76519e6 (patch)
tree60b181c4bd856fd212a62c9109f1ed8f49ef52b8 /libass
parent5714f9267d058a29cc13e199e0d3d0f2088d1811 (diff)
downloadlibass-bd097e377089b3c7e8ae0c6f10495003b76519e6.tar.bz2
libass-bd097e377089b3c7e8ae0c6f10495003b76519e6.tar.xz
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.)
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_render.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index b405153..272a1e8 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 =