diff --git a/src/compositor.h b/src/compositor.h index f4ba7a5e..bb7562fc 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -160,10 +160,6 @@ struct weston_output_zoom { float trans_x, trans_y; struct weston_animation animation_z; struct weston_spring spring_z; - struct weston_animation animation_xy; - struct weston_spring spring_xy; - struct weston_fixed_point from; - struct weston_fixed_point to; struct weston_fixed_point current; struct wl_listener motion_listener; }; diff --git a/src/zoom.c b/src/zoom.c index f71d08cc..16d487da 100644 --- a/src/zoom.c +++ b/src/zoom.c @@ -63,39 +63,6 @@ weston_zoom_pick_seat(struct weston_compositor *compositor) struct weston_seat, link); } - -static void -weston_zoom_frame_xy(struct weston_animation *animation, - struct weston_output *output, uint32_t msecs) -{ - struct weston_seat *seat = weston_zoom_pick_seat(output->compositor); - wl_fixed_t x, y; - - if (animation->frame_counter <= 1) - output->zoom.spring_xy.timestamp = msecs; - - weston_spring_update(&output->zoom.spring_xy, msecs); - - x = output->zoom.from.x - ((output->zoom.from.x - output->zoom.to.x) * - output->zoom.spring_xy.current); - y = output->zoom.from.y - ((output->zoom.from.y - output->zoom.to.y) * - output->zoom.spring_xy.current); - - output->zoom.current.x = x; - output->zoom.current.y = y; - - if (weston_spring_done(&output->zoom.spring_xy)) { - output->zoom.spring_xy.current = output->zoom.spring_xy.target; - output->zoom.current.x = seat->pointer->x; - output->zoom.current.y = seat->pointer->y; - wl_list_remove(&animation->link); - wl_list_init(&animation->link); - } - - output->dirty = 1; - weston_output_damage(output); -} - static void zoom_area_center_from_pointer(struct weston_output *output, wl_fixed_t *x, wl_fixed_t *y) @@ -127,8 +94,7 @@ weston_output_update_zoom_transform(struct weston_output *output) ratio = 1 / level; - if (wl_list_empty(&output->zoom.animation_xy.link)) - zoom_area_center_from_pointer(output, &x, &y); + zoom_area_center_from_pointer(output, &x, &y); global_x = wl_fixed_to_double(x); global_y = wl_fixed_to_double(y); @@ -179,13 +145,8 @@ weston_output_update_zoom(struct weston_output *output) zoom_area_center_from_pointer(output, &x, &y); - if (wl_list_empty(&output->zoom.animation_xy.link)) { - output->zoom.current.x = seat->pointer->x; - output->zoom.current.y = seat->pointer->y; - } else { - output->zoom.to.x = x; - output->zoom.to.y = y; - } + output->zoom.current.x = seat->pointer->x; + output->zoom.current.y = seat->pointer->y; weston_zoom_transition(output, x, y); weston_output_update_zoom_transform(output); @@ -229,9 +190,5 @@ weston_output_init_zoom(struct weston_output *output) output->zoom.spring_z.friction = 1000; output->zoom.animation_z.frame = weston_zoom_frame_z; wl_list_init(&output->zoom.animation_z.link); - weston_spring_init(&output->zoom.spring_xy, 250.0, 0.0, 0.0); - output->zoom.spring_xy.friction = 1000; - output->zoom.animation_xy.frame = weston_zoom_frame_xy; - wl_list_init(&output->zoom.animation_xy.link); output->zoom.motion_listener.notify = motion; }