zoom: Remove unneeded usage of wl_fixed_ts in favour of doubles

Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
This commit is contained in:
Giulio Camuffo 2015-10-07 20:14:18 +03:00 committed by Derek Foreman
parent 4845354cfa
commit 6850e7b9e1
2 changed files with 14 additions and 16 deletions

View File

@ -144,20 +144,18 @@ struct weston_spring {
uint32_t clip; uint32_t clip;
}; };
struct weston_fixed_point {
wl_fixed_t x, y;
};
struct weston_output_zoom { struct weston_output_zoom {
bool active; bool active;
float increment; float increment;
float level; float level;
float max_level; float max_level;
float trans_x, trans_y; float trans_x, trans_y;
struct {
double x, y;
} current;
struct weston_seat *seat; struct weston_seat *seat;
struct weston_animation animation_z; struct weston_animation animation_z;
struct weston_spring spring_z; struct weston_spring spring_z;
struct weston_fixed_point current;
struct wl_listener motion_listener; struct wl_listener motion_listener;
}; };

View File

@ -65,13 +65,13 @@ weston_zoom_frame_z(struct weston_animation *animation,
static void static void
zoom_area_center_from_point(struct weston_output *output, zoom_area_center_from_point(struct weston_output *output,
wl_fixed_t *x, wl_fixed_t *y) double *x, double *y)
{ {
float level = output->zoom.spring_z.current; float level = output->zoom.spring_z.current;
wl_fixed_t offset_x = wl_fixed_from_int(output->x); double offset_x = output->x;
wl_fixed_t offset_y = wl_fixed_from_int(output->y); double offset_y = output->y;
wl_fixed_t w = wl_fixed_from_int(output->width); double w = output->width;
wl_fixed_t h = wl_fixed_from_int(output->height); double h = output->height;
*x = (*x - offset_x) * level + w / 2; *x = (*x - offset_x) * level + w / 2;
*y = (*y - offset_y) * level + h / 2; *y = (*y - offset_y) * level + h / 2;
@ -81,8 +81,8 @@ static void
weston_output_update_zoom_transform(struct weston_output *output) weston_output_update_zoom_transform(struct weston_output *output)
{ {
float global_x, global_y; float global_x, global_y;
wl_fixed_t x = output->zoom.current.x; /* global pointer coords */ double x = output->zoom.current.x; /* global pointer coords */
wl_fixed_t y = output->zoom.current.y; double y = output->zoom.current.y;
float level; float level;
level = output->zoom.spring_z.current; level = output->zoom.spring_z.current;
@ -93,8 +93,8 @@ weston_output_update_zoom_transform(struct weston_output *output)
zoom_area_center_from_point(output, &x, &y); zoom_area_center_from_point(output, &x, &y);
global_x = wl_fixed_to_double(x); global_x = x;
global_y = wl_fixed_to_double(y); global_y = y;
output->zoom.trans_x = global_x - output->width / 2; output->zoom.trans_x = global_x - output->width / 2;
output->zoom.trans_y = global_y - output->height / 2; output->zoom.trans_y = global_y - output->height / 2;
@ -133,8 +133,8 @@ weston_output_update_zoom(struct weston_output *output)
assert(output->zoom.active); assert(output->zoom.active);
output->zoom.current.x = pointer->x; output->zoom.current.x = wl_fixed_to_double(pointer->x);
output->zoom.current.y = pointer->y; output->zoom.current.y = wl_fixed_to_double(pointer->y);
weston_zoom_transition(output); weston_zoom_transition(output);
weston_output_update_zoom_transform(output); weston_output_update_zoom_transform(output);