wlt: toolkit: fix wlt_rect_contains() calculations

We need to check whether the point is left/atop of the rectangle, too.
Otherwise, the function just doesn't make sense.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-10-05 13:47:15 +02:00
parent 202fa3b766
commit 83d36af4a1

View File

@ -179,6 +179,8 @@ static inline bool wlt_rect_contains(struct wlt_rect *rect,
unsigned int x,
unsigned int y)
{
if (x < rect->x || y < rect->y)
return false;
if (x >= rect->x + rect->width)
return false;
if (y >= rect->y + rect->height)