diff options
author | wm4 <wm4@nowhere> | 2015-05-25 17:58:48 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-05-25 17:58:48 +0200 |
commit | da32da6fbc5b11effaa716aab0a1aacda8a1fe05 (patch) | |
tree | 53b7a7a0ff76a1fdd7053adfbb15dab25114fc44 /libass | |
parent | aeff4a76860cdb40bcc886b006a05182bff78cbf (diff) | |
download | libass-da32da6fbc5b11effaa716aab0a1aacda8a1fe05.tar.bz2 libass-da32da6fbc5b11effaa716aab0a1aacda8a1fe05.tar.xz |
Strictly clip non-dialog events against the video rectangle
Only normal dialog lines are allowed to appear outside.
Fixes #177.
Diffstat (limited to 'libass')
-rw-r--r-- | libass/ass_render.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c index f471c819..c49dd5c0 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -2631,6 +2631,19 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event, y2scr_pos(render_priv, render_priv->state.clip_y1); } + if (render_priv->state.explicit) { + // we still need to clip against screen boundaries + double zx = x2scr_pos_scaled(render_priv, 0); + double zy = y2scr_pos(render_priv, 0); + double sx = x2scr_pos_scaled(render_priv, render_priv->track->PlayResX); + double sy = y2scr_pos(render_priv, render_priv->track->PlayResY); + + render_priv->state.clip_x0 = render_priv->state.clip_x0 < zx ? zx : render_priv->state.clip_x0; + render_priv->state.clip_y0 = render_priv->state.clip_y0 < zy ? zy : render_priv->state.clip_y0; + render_priv->state.clip_x1 = render_priv->state.clip_x1 > sx ? sx : render_priv->state.clip_x1; + render_priv->state.clip_y1 = render_priv->state.clip_y1 > sy ? sy : render_priv->state.clip_y1; + } + calculate_rotation_params(render_priv, &bbox, device_x, device_y); render_and_combine_glyphs(render_priv, device_x, device_y); |