Remove width_mm from wlr_touch events

This commit is contained in:
Drew DeVault 2018-03-28 11:04:40 -04:00
parent a35a5786b0
commit 324b9d910d
10 changed files with 37 additions and 46 deletions

View file

@ -640,19 +640,15 @@ void wlr_cursor_map_input_to_region(struct wlr_cursor *cur,
}
bool wlr_cursor_absolute_to_layout_coords(struct wlr_cursor *cur,
struct wlr_input_device *device, double x_mm, double y_mm,
double width_mm, double height_mm, double *lx, double *ly) {
if (width_mm <= 0 || height_mm <= 0) {
return false;
}
struct wlr_input_device *device, double x, double y,
double *lx, double *ly) {
struct wlr_box *mapping = get_mapping(cur, device);
if (!mapping) {
mapping = wlr_output_layout_get_box(cur->state->layout, NULL);
}
*lx = x_mm > 0 ? mapping->width * (x_mm / width_mm) + mapping->x : cur->x;
*ly = y_mm > 0 ? mapping->height * (y_mm / height_mm) + mapping->y : cur->y;
*lx = x > 0 ? mapping->width * x + mapping->x : cur->x;
*ly = y > 0 ? mapping->height * y + mapping->y : cur->y;
return true;
}