mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-01-09 14:19:27 +00:00
rect: add rect_contains
This commit is contained in:
parent
f37ba0d032
commit
2e4b605272
@ -74,6 +74,12 @@ static INLINE int rect_is_same_size(const SpiceRect *r1, const SpiceRect *r2)
|
||||
r1->bottom - r1->top == r2->bottom - r2->top;
|
||||
}
|
||||
|
||||
static INLINE int rect_contains(const SpiceRect *big, const SpiceRect *small)
|
||||
{
|
||||
return big->left <= small->left && big->right >= small->right &&
|
||||
big->top <= small->top && big->bottom >= small->bottom;
|
||||
}
|
||||
|
||||
SPICE_END_DECLS
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -113,6 +119,11 @@ static inline int rect_is_same_size(const SpiceRect& r1, const SpiceRect& r2)
|
||||
return rect_is_same_size(&r1, &r2);
|
||||
}
|
||||
|
||||
static inline int rect_contains(const SpiceRect& big, const SpiceRect& small)
|
||||
{
|
||||
return rect_contains(&big, &small);
|
||||
}
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user