mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +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: https://github.com/SerenityOS/serenity/commit/a2bffc850a3 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_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
|
||||
{
|
||||
return m_width == other.m_width && m_height == other.m_height;
|
||||
|
|
Loading…
Add table
Reference in a new issue