Convert wl_fixed_t to int in weston_output_update_zoom().

This way, we don't have to use wl_fixed_to_int() for each
call to weston_output_update_zoom(). It accepts wl_fixed_t
types and converts internally.
dev
Scott Moreau 13 years ago committed by Kristian Høgsberg
parent 0b61130bae
commit dc549932b7
  1. 6
      src/compositor.c
  2. 4
      src/shell.c

@ -2356,13 +2356,17 @@ weston_output_destroy(struct weston_output *output)
} }
WL_EXPORT void WL_EXPORT void
weston_output_update_zoom(struct weston_output *output, int x, int y) weston_output_update_zoom(struct weston_output *output, wl_fixed_t fx, wl_fixed_t fy)
{ {
float ratio; float ratio;
int32_t x, y;
if (output->zoom.level <= 0) if (output->zoom.level <= 0)
return; return;
x = wl_fixed_to_int(fx);
y = wl_fixed_to_int(fy);
output->zoom.magnification = 1 / output->zoom.level; output->zoom.magnification = 1 / output->zoom.level;
ratio = 1 - (1 / output->zoom.magnification); ratio = 1 - (1 / output->zoom.magnification);

@ -1642,9 +1642,7 @@ zoom_binding(struct wl_input_device *device, uint32_t time,
if (output->zoom.level < output->zoom.increment) if (output->zoom.level < output->zoom.increment)
output->zoom.level = output->zoom.increment; output->zoom.level = output->zoom.increment;
weston_output_update_zoom(output, weston_output_update_zoom(output, device->x, device->y);
wl_fixed_to_int(device->x),
wl_fixed_to_int(device->y));
} }
} }
} }

Loading…
Cancel
Save