mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-01-29 10:00:24 +01:00
eis: expose eis_region_contains
Same as the libei function, there's a use-case for this especially when dealing with receiver contexts. libei filters those but we can't rely on that in the server so using this is a workaround.
This commit is contained in:
parent
fc79982682
commit
b5f0899352
3 changed files with 9 additions and 4 deletions
|
|
@ -132,7 +132,7 @@ eis_region_add(struct eis_region *region)
|
|||
eis_device_unref(region->device);
|
||||
}
|
||||
|
||||
bool
|
||||
_public_ bool
|
||||
eis_region_contains(struct eis_region *r, double x, double y)
|
||||
{
|
||||
return (x >= r->x && x < r->x + r->width &&
|
||||
|
|
|
|||
|
|
@ -39,6 +39,3 @@ struct eis_region {
|
|||
uint32_t width, height;
|
||||
double physical_scale;
|
||||
};
|
||||
|
||||
bool
|
||||
eis_region_contains(struct eis_region *r, double x, double y);
|
||||
|
|
|
|||
|
|
@ -1007,6 +1007,14 @@ eis_region_get_height(struct eis_region *region);
|
|||
double
|
||||
eis_region_get_physical_scale(struct eis_region *region);
|
||||
|
||||
/**
|
||||
* @ingroup libeis-region
|
||||
*
|
||||
* @see ei_region_contains
|
||||
*/
|
||||
bool
|
||||
eis_region_contains(struct eis_region *region, double x, double y);
|
||||
|
||||
/**
|
||||
* @ingroup libeis-device
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue