changeset 28841:56d8b860a41b

Fix clipping for pan-and-scan.
author greg
date Sun, 08 Mar 2009 04:03:28 +0000
parents 7d0ea9013974
children e9ba9214fabe
files libass/ass_render.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libass/ass_render.c	Sun Mar 08 04:03:24 2009 +0000
+++ b/libass/ass_render.c	Sun Mar 08 04:03:28 2009 +0000
@@ -2108,11 +2108,11 @@
 	}
 	
 	// fix clip coordinates (they depend on alignment)
-	render_context.clip_x0 = x2scr(render_context.clip_x0);
-	render_context.clip_x1 = x2scr(render_context.clip_x1);
 	if (render_context.evt_type == EVENT_NORMAL ||
 	    render_context.evt_type == EVENT_HSCROLL ||
 	    render_context.evt_type == EVENT_VSCROLL) {
+		render_context.clip_x0 = x2scr(render_context.clip_x0);
+		render_context.clip_x1 = x2scr(render_context.clip_x1);
 		if (valign == VALIGN_TOP) {
 			render_context.clip_y0 = y2scr_top(render_context.clip_y0);
 			render_context.clip_y1 = y2scr_top(render_context.clip_y1);
@@ -2124,8 +2124,10 @@
 			render_context.clip_y1 = y2scr_sub(render_context.clip_y1);
 		}
 	} else if (render_context.evt_type == EVENT_POSITIONED) {
-		render_context.clip_y0 = y2scr(render_context.clip_y0);
-		render_context.clip_y1 = y2scr(render_context.clip_y1);
+		render_context.clip_x0 = x2scr_pos(render_context.clip_x0);
+		render_context.clip_x1 = x2scr_pos(render_context.clip_x1);
+		render_context.clip_y0 = y2scr_pos(render_context.clip_y0);
+		render_context.clip_y1 = y2scr_pos(render_context.clip_y1);
 	}
 
 	// calculate rotation parameters