diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/geometry_type.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/geometry_type.hpp b/src/core/geometry_type.hpp index d1f363127..2927cd980 100644 --- a/src/core/geometry_type.hpp +++ b/src/core/geometry_type.hpp @@ -29,6 +29,20 @@ struct Point { struct Dimension { uint width; uint height; + + Dimension(uint w = 0, uint h = 0) : width(w), height(h) {}; + + bool operator< (const Dimension &other) const + { + int x = (*this).width - other.width; + if (x != 0) return x < 0; + return (*this).height < other.height; + } + + bool operator== (const Dimension &other) const + { + return (*this).width == other.width && (*this).height == other.height; + } }; /** Specification of a rectangle with absolute coordinates of all edges */ |