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 <ppaalanen@gmail.com>
This commit is contained in:
Pekka Paalanen 2012-01-25 14:45:18 +02:00
parent f1f5b36aeb
commit 7377204315

View File

@ -135,12 +135,10 @@ weston_zoom_frame(struct weston_animation *animation,
(zoom->stop - zoom->start) * zoom->spring.current; (zoom->stop - zoom->start) * zoom->spring.current;
weston_matrix_init(&zoom->transform.matrix); weston_matrix_init(&zoom->transform.matrix);
weston_matrix_translate(&zoom->transform.matrix, weston_matrix_translate(&zoom->transform.matrix,
-(es->geometry.x + es->width / 2.0), -0.5f * es->width, -0.5f * es->height, 0);
-(es->geometry.y + es->height / 2.0), 0);
weston_matrix_scale(&zoom->transform.matrix, scale, scale, scale); weston_matrix_scale(&zoom->transform.matrix, scale, scale, scale);
weston_matrix_translate(&zoom->transform.matrix, weston_matrix_translate(&zoom->transform.matrix,
es->geometry.x + es->width / 2.0, 0.5f * es->width, 0.5f * es->height, 0);
es->geometry.y + es->height / 2.0, 0);
es->alpha = zoom->spring.current * 255; es->alpha = zoom->spring.current * 255;
if (es->alpha > 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, wl_list_insert(surface->surface.resource.destroy_listener_list.prev,
&zoom->listener.link); &zoom->listener.link);
wl_list_insert(surface->compositor->animation_list.prev, wl_list_insert(&surface->compositor->animation_list,
&zoom->animation.link); &zoom->animation.link);
return zoom; return zoom;