diff options
Diffstat (limited to 'src/math.hpp')
-rw-r--r-- | src/math.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/math.hpp b/src/math.hpp index 5e117fd..e393015 100644 --- a/src/math.hpp +++ b/src/math.hpp @@ -352,6 +352,16 @@ public: return r; } + friend rect_t<T, N> operator+(const rect_t<T, N> &a, const vec_t<T, N> &b) + { + rect_t<T, N> r; + + r[0] = a[0] + b; + r[1] = a[1] + b; + + return r; + } + friend std::ostream& operator<<(std::ostream& stream, rect_t<T, N> r) { stream << "(" << r[0] << " x " << r[1] << ")"; |