LibGfx: Allow comparing Points, Sizes, and Rects of different type

This commit is contained in:
Nico Weber 2021-01-22 15:12:37 -05:00 committed by Andreas Kling
commit 7278ff6605
Notes: sideshowbarker 2024-07-18 22:59:44 +09:00
3 changed files with 15 additions and 9 deletions

View file

@ -354,12 +354,14 @@ public:
Vector<Rect<T>, 4> shatter(const Rect<T>& hammer) const;
bool operator==(const Rect<T>& other) const
template<class U>
bool operator==(const Rect<U>& other) const
{
return m_location == other.m_location && m_size == other.m_size;
return location() == other.location() && size() == other.size();
}
bool operator!=(const Rect<T>& other) const
template<class U>
bool operator!=(const Rect<U>& other) const
{
return !(*this == other);
}