From 73772043154700751894d6698a5d5ef6d6bccc4f Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Wed, 25 Jan 2012 14:45:18 +0200 Subject: [PATCH] compositor: fix zoom origin Now that we can insert a transformation before the surface position translation, we can drop geometry.x,y from the zoom transformation. That was just undoing and redoing the position translation. Signed-off-by: Pekka Paalanen --- src/util.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/util.c b/src/util.c index a19df51a..fed4b8a9 100644 --- a/src/util.c +++ b/src/util.c @@ -135,12 +135,10 @@ weston_zoom_frame(struct weston_animation *animation, (zoom->stop - zoom->start) * zoom->spring.current; weston_matrix_init(&zoom->transform.matrix); weston_matrix_translate(&zoom->transform.matrix, - -(es->geometry.x + es->width / 2.0), - -(es->geometry.y + es->height / 2.0), 0); + -0.5f * es->width, -0.5f * es->height, 0); weston_matrix_scale(&zoom->transform.matrix, scale, scale, scale); weston_matrix_translate(&zoom->transform.matrix, - es->geometry.x + es->width / 2.0, - es->geometry.y + es->height / 2.0, 0); + 0.5f * es->width, 0.5f * es->height, 0); es->alpha = zoom->spring.current * 255; if (es->alpha > 255) @@ -178,7 +176,7 @@ weston_zoom_run(struct weston_surface *surface, GLfloat start, GLfloat stop, wl_list_insert(surface->surface.resource.destroy_listener_list.prev, &zoom->listener.link); - wl_list_insert(surface->compositor->animation_list.prev, + wl_list_insert(&surface->compositor->animation_list, &zoom->animation.link); return zoom;