mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-08-07 22:10:37 +00:00
rect: add rect_get_area
This commit is contained in:
parent
2e4b605272
commit
ffeb6ce677
@ -80,6 +80,11 @@ static INLINE int rect_contains(const SpiceRect *big, const SpiceRect *small)
|
||||
big->top <= small->top && big->bottom >= small->bottom;
|
||||
}
|
||||
|
||||
static INLINE int rect_get_area(const SpiceRect *r)
|
||||
{
|
||||
return (r->right - r->left) * (r->bottom - r->top);
|
||||
}
|
||||
|
||||
SPICE_END_DECLS
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -124,6 +129,11 @@ static inline int rect_contains(const SpiceRect& big, const SpiceRect& small)
|
||||
return rect_contains(&big, &small);
|
||||
}
|
||||
|
||||
static inline int rect_get_area(const SpiceRect& r)
|
||||
{
|
||||
return rect_get_area(&r);
|
||||
}
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user