mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-12 13:29:55 -05:00
Fix surface coordinate transformation.
This commit is contained in:
parent
1a208d58cb
commit
6c9c8f8923
1 changed files with 6 additions and 4 deletions
|
|
@ -861,15 +861,17 @@ pick_surface(struct wlsc_input_device *device, int32_t *sx, int32_t *sy)
|
||||||
if (es->map.x <= device->x &&
|
if (es->map.x <= device->x &&
|
||||||
device->x < es->map.x + es->map.width &&
|
device->x < es->map.x + es->map.width &&
|
||||||
es->map.y <= device->y &&
|
es->map.y <= device->y &&
|
||||||
device->y < es->map.y + es->map.height)
|
device->y < es->map.y + es->map.height) {
|
||||||
|
/* Transform to surface coordinates. */
|
||||||
|
*sx = (device->x - es->map.x) * es->width / es->map.width;
|
||||||
|
*sy = (device->y - es->map.y) * es->height / es->map.height;
|
||||||
|
|
||||||
return es;
|
return es;
|
||||||
|
}
|
||||||
|
|
||||||
es = container_of(es->link.prev,
|
es = container_of(es->link.prev,
|
||||||
struct wlsc_surface, link);
|
struct wlsc_surface, link);
|
||||||
|
|
||||||
/* Transform to surface coordinates. */
|
|
||||||
*sx = (device->x - es->map.x) * es->width / es->map.width;
|
|
||||||
*sy = (device->y - es->map.y) * es->height / es->map.height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue