summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-11 22:01:51 +0200
committerwm4 <wm4@nowhere>2015-06-11 22:01:51 +0200
commit547850d9c0250ea730603c522f78c44b6b1049f1 (patch)
treee64f92a5ce12439e6ab60d4c97559775091936d1 /libass
parent8c8741fe2000d4b4d89a53f894363a42288cec3e (diff)
downloadlibass-547850d9c0250ea730603c522f78c44b6b1049f1.tar.bz2
libass-547850d9c0250ea730603c522f78c44b6b1049f1.tar.xz
Do not apply ass_set_line_position() to positioned events
Even if we wanted this, the result would be inconsistent if e.g. \clip is used.
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_render.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 0dc6fb4..c873330 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -2549,6 +2549,8 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event,
y2scr(render_priv, render_priv->track->PlayResY / 2.0);
device_y = scr_y - (bbox.yMax + bbox.yMin) / 2.0;
} else { // subtitle
+ double line_pos = render_priv->state.explicit ?
+ 0 : render_priv->settings.line_position;
double scr_top, scr_bottom, scr_y0;
if (valign != VALIGN_SUB)
ass_msg(render_priv->library, MSGL_V,
@@ -2557,15 +2559,14 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event,
y2scr_sub(render_priv,
render_priv->track->PlayResY - MarginV);
scr_top = y2scr_top(render_priv, 0); //xxx not always 0?
- device_y = scr_bottom + (scr_top - scr_bottom) *
- render_priv->settings.line_position / 100.0;
+ device_y = scr_bottom + (scr_top - scr_bottom) * line_pos / 100.0;
device_y -= text_info->height;
device_y += text_info->lines[0].asc;
// clip to top to avoid confusion if line_position is very high,
// turning the subtitle into a toptitle
// also, don't change behavior if line_position is not used
scr_y0 = scr_top + text_info->lines[0].asc;
- if (device_y < scr_y0 && render_priv->settings.line_position > 0) {
+ if (device_y < scr_y0 && line_pos > 0) {
device_y = scr_y0;
}
}