diff --git a/dgl/Geometry.hpp b/dgl/Geometry.hpp index 76d9c158..1f6433b0 100644 --- a/dgl/Geometry.hpp +++ b/dgl/Geometry.hpp @@ -219,6 +219,8 @@ public: Size& operator-=(const Size& size) noexcept; Size& operator*=(double m) noexcept; Size& operator/=(double d) noexcept; + Size operator*(double m) const noexcept; + Size operator/(double m) const noexcept; bool operator==(const Size& size) const noexcept; bool operator!=(const Size& size) const noexcept; diff --git a/dgl/src/Geometry.cpp b/dgl/src/Geometry.cpp index 926814ba..dafa7089 100644 --- a/dgl/src/Geometry.cpp +++ b/dgl/src/Geometry.cpp @@ -324,6 +324,22 @@ Size& Size::operator/=(double d) noexcept return *this; } +template +Size Size::operator*(const double m) const noexcept +{ + Size size(fWidth, fHeight); + size *= m; + return size; +} + +template +Size Size::operator/(const double m) const noexcept +{ + Size size(fWidth, fHeight); + size /= m; + return size; +} + template bool Size::operator==(const Size& size) const noexcept {