changeset 28748:06983ef189b9

With pan-and-scan, keep positioned events in their original positions relative to video. Patch by Grigori Goronzy (greg chown ath cx).
author eugeni
date Sun, 01 Mar 2009 16:01:24 +0000
parents 983d33669b6b
children 4392751ddd24
files libass/ass_render.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libass/ass_render.c	Sun Mar 01 15:55:20 2009 +0000
+++ b/libass/ass_render.c	Sun Mar 01 16:01:24 2009 +0000
@@ -467,6 +467,10 @@
 	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 @@
 		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;
 	}