change output layout coords to double type

This commit is contained in:
Tony Crisci 2017-08-24 11:46:40 -04:00
parent f69a7afd36
commit a4810203cc
4 changed files with 10 additions and 11 deletions

View file

@ -82,10 +82,9 @@ bool wlr_cursor_warp(struct wlr_cursor *cur, double x, double y) {
struct wlr_output_layout_output *l_output;
wl_list_for_each(l_output, &cur->state->layout->outputs, link) {
int output_x = x;
int output_y = y;
double output_x = x;
double output_y = y;
// TODO fix double to int rounding issues
wlr_output_layout_output_coords(cur->state->layout,
l_output->output, &output_x, &output_y);
wlr_output_move_cursor(l_output->output, output_x - hotspot_x,

View file

@ -113,16 +113,16 @@ void wlr_output_layout_remove(struct wlr_output_layout *layout,
}
void wlr_output_layout_output_coords(struct wlr_output_layout *layout,
struct wlr_output *reference, int *x, int *y) {
struct wlr_output *reference, double *x, double *y) {
assert(layout && reference);
int src_x = *x;
int src_y = *y;
double src_x = *x;
double src_y = *y;
struct wlr_output_layout_output *_output;
wl_list_for_each(_output, &layout->outputs, link) {
if (_output->output == reference) {
*x = src_x - _output->x;
*y = src_y - _output->y;
*x = src_x - (double)_output->x;
*y = src_y - (double)_output->y;
return;
}
}