1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

LibGfx: Add Size::contains

This commit is contained in:
Tom 2020-10-02 19:24:34 -06:00 committed by Andreas Kling
parent 8af02fc8b3
commit a2bffc850a

View file

@ -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;