diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-10-05 13:47:15 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2012-10-05 13:47:15 +0200 |
commit | 83d36af4a174b6053afa269a7e456528355e76cf (patch) | |
tree | 1038941509f40deff58ce351fd6511af97cf490b /src/wlt_toolkit.h | |
parent | 202fa3b766257d90010ee8fb4ce13dd970211c04 (diff) |
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>
Diffstat (limited to 'src/wlt_toolkit.h')
-rw-r--r-- | src/wlt_toolkit.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wlt_toolkit.h b/src/wlt_toolkit.h index 01d557b..263e76f 100644 --- a/src/wlt_toolkit.h +++ b/src/wlt_toolkit.h @@ -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) |