diff options
author | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-03-01 16:01:24 +0000 |
---|---|---|
committer | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-03-01 16:01:24 +0000 |
commit | 9c8a334cc5ba98c60dfce3aad490a80b1727ea50 (patch) | |
tree | 73805427bc9cfb1748e22c207294ccbebda96979 | |
parent | abb8f13f7f2e38e91c76bc515b0ee5525aee7f15 (diff) | |
download | mpv-9c8a334cc5ba98c60dfce3aad490a80b1727ea50.tar.bz2 mpv-9c8a334cc5ba98c60dfce3aad490a80b1727ea50.tar.xz |
With pan-and-scan, keep positioned events in their original positions
relative to video.
Patch by Grigori Goronzy (greg chown ath cx).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28783 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libass/ass_render.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c index ead118ddde..a40adec505 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -467,6 +467,10 @@ static int x2scr(double x) { return x*frame_context.orig_width_nocrop / frame_context.track->PlayResX + FFMAX(global_settings->left_margin, 0); } +static int x2scr_pos(double x) { + return x*frame_context.orig_width / frame_context.track->PlayResX + + global_settings->left_margin; +} /** * \brief Mapping between script and screen coordinates */ @@ -2014,7 +2018,7 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images) int base_y = 0; mp_msg(MSGT_ASS, MSGL_DBG2, "positioned event at %f, %f\n", render_context.pos_x, render_context.pos_y); get_base_point(bbox, alignment, &base_x, &base_y); - device_x = x2scr(render_context.pos_x) - base_x; + device_x = x2scr_pos(render_context.pos_x) - base_x; device_y = y2scr(render_context.pos_y) - base_y; } |