mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 02:58:02 +02:00
zoom: remove animation_xy as unused
Remove several fields from struct weston_output_zoom as a consequence of
removing animation_xy from it. Animation_xy was always empty, unused.
Animation_xy was likely used by text_cursor_position implementation, but
that was removed in commit a7af70436b.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Rviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
f3744f5e86
commit
13fd446514
2 changed files with 3 additions and 50 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
49
src/zoom.c
49
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue