summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGfx/Point.h8
-rw-r--r--Userland/Libraries/LibGfx/Rect.h8
-rw-r--r--Userland/Libraries/LibGfx/Size.h8
3 files changed, 15 insertions, 9 deletions
diff --git a/Userland/Libraries/LibGfx/Point.h b/Userland/Libraries/LibGfx/Point.h
index 753d04055a..be6a71e149 100644
--- a/Userland/Libraries/LibGfx/Point.h
+++ b/Userland/Libraries/LibGfx/Point.h
@@ -107,12 +107,14 @@ public:
return point;
}
- bool operator==(const Point<T>& other) const
+ template<class U>
+ bool operator==(const Point<U>& other) const
{
- return m_x == other.m_x && m_y == other.m_y;
+ return x() == other.x() && y() == other.y();
}
- bool operator!=(const Point<T>& other) const
+ template<class U>
+ bool operator!=(const Point<U>& other) const
{
return !(*this == other);
}
diff --git a/Userland/Libraries/LibGfx/Rect.h b/Userland/Libraries/LibGfx/Rect.h
index f54ff43fbf..e9ad4b136e 100644
--- a/Userland/Libraries/LibGfx/Rect.h
+++ b/Userland/Libraries/LibGfx/Rect.h
@@ -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);
}
diff --git a/Userland/Libraries/LibGfx/Size.h b/Userland/Libraries/LibGfx/Size.h
index 7b0cbe96fc..67321a4a2d 100644
--- a/Userland/Libraries/LibGfx/Size.h
+++ b/Userland/Libraries/LibGfx/Size.h
@@ -74,12 +74,14 @@ public:
return other.m_width <= m_width && other.m_height <= m_height;
}
- bool operator==(const Size<T>& other) const
+ template<class U>
+ bool operator==(const Size<U>& other) const
{
- return m_width == other.m_width && m_height == other.m_height;
+ return width() == other.width() && height() == other.height();
}
- bool operator!=(const Size<T>& other) const
+ template<class U>
+ bool operator!=(const Size<U>& other) const
{
return !(*this == other);
}