mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +00:00
LibGfx: Add Size::contains
This commit is contained in:
parent
8af02fc8b3
commit
a2bffc850a
Notes:
sideshowbarker
2024-07-19 01:55:23 +09:00
Author: https://github.com/tomuta
Commit: a2bffc850a
Pull-request: https://github.com/SerenityOS/serenity/pull/3751
1 changed files with 6 additions and 0 deletions
|
@ -68,6 +68,12 @@ public:
|
||||||
void set_width(T w) { m_width = w; }
|
void set_width(T w) { m_width = w; }
|
||||||
void set_height(T h) { m_height = h; }
|
void set_height(T h) { m_height = h; }
|
||||||
|
|
||||||
|
template<typename U>
|
||||||
|
bool contains(const Size<U>& other) const
|
||||||
|
{
|
||||||
|
return other.m_width <= m_width && other.m_height <= m_height;
|
||||||
|
}
|
||||||
|
|
||||||
bool operator==(const Size<T>& other) const
|
bool operator==(const Size<T>& other) const
|
||||||
{
|
{
|
||||||
return m_width == other.m_width && m_height == other.m_height;
|
return m_width == other.m_width && m_height == other.m_height;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue