mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:57:34 +00:00
Rect: Add contains_vertically(y) and contains_horizontally(x)
This commit is contained in:
parent
c686264703
commit
72a29d72d3
1 changed files with 10 additions and 0 deletions
|
@ -115,6 +115,16 @@ public:
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool contains_vertically(int y) const
|
||||||
|
{
|
||||||
|
return y >= top() && y <= bottom();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool contains_horizontally(int x) const
|
||||||
|
{
|
||||||
|
return x >= left() && x <= right();
|
||||||
|
}
|
||||||
|
|
||||||
bool contains(int x, int y) const
|
bool contains(int x, int y) const
|
||||||
{
|
{
|
||||||
return x >= m_location.x() && x <= right() && y >= m_location.y() && y <= bottom();
|
return x >= m_location.x() && x <= right() && y >= m_location.y() && y <= bottom();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue