mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 00:24:51 +00:00
os: Add Rect::contains() to geometry utils
This commit is contained in:
parent
3e4eb0d135
commit
fb673fe4fd
@ -135,6 +135,12 @@ class Genode::Rect
|
||||
*/
|
||||
bool fits(Area<DT> area) const { return w() >= area.w() && h() >= area.h(); }
|
||||
|
||||
/**
|
||||
* Return true if the specified point lies within the rectangle
|
||||
*/
|
||||
bool contains(Point<CT> p) const {
|
||||
return p.x() >= x1() && p.x() <= x2() && p.y() >= y1() && p.y() <= y2(); }
|
||||
|
||||
/**
|
||||
* Create new rectangle by intersecting two rectangles
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user