aboutsummaryrefslogtreecommitdiffhomepage
path: root/libass
diff options
context:
space:
mode:
authorGravatar greg <greg@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-03-05 20:36:59 +0000
committerGravatar greg <greg@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-03-05 20:36:59 +0000
commit8ad008e12aa377fa54c1ed7c218c48d01392bdc7 (patch)
treea6d7b04acc26db7c74b7cc44edb259040bf70888 /libass
parentf9aba2b83aaffe806749031be747bebe853453ca (diff)
Fix positioned events' y-position when pan-and-scan is used.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28823 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_render.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 9db00b0773..5027c29110 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -485,6 +485,11 @@ static double y2scr(double y) {
return y * frame_context.orig_height_nocrop / frame_context.track->PlayResY +
FFMAX(global_settings->top_margin, 0);
}
+static double y2scr_pos(double y) {
+ return y * frame_context.orig_height / frame_context.track->PlayResY +
+ global_settings->top_margin;
+}
+
// the same for toptitles
static int y2scr_top(double y) {
if (global_settings->use_margins)
@@ -1864,7 +1869,7 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images)
if (render_context.evt_type == EVENT_POSITIONED) {
shift.x += double_to_d6(x2scr_pos(render_context.pos_x)) & 56;
- shift.y -= double_to_d6(y2scr(render_context.pos_y)) & 56;
+ shift.y -= double_to_d6(y2scr_pos(render_context.pos_y)) & 56;
}
ass_font_set_transform(render_context.font,
@@ -2031,7 +2036,7 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images)
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_pos(render_context.pos_x) - base_x;
- device_y = y2scr(render_context.pos_y) - base_y;
+ device_y = y2scr_pos(render_context.pos_y) - base_y;
}
// fix clip coordinates (they depend on alignment)