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
Notes: sideshowbarker 2024-07-19 01:55:23 +09:00

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;