diff --git a/inc/basic_widgets/core/type/size.hpp b/inc/basic_widgets/core/type/size.hpp index fed68c4..ad1260b 100644 --- a/inc/basic_widgets/core/type/size.hpp +++ b/inc/basic_widgets/core/type/size.hpp @@ -9,26 +9,29 @@ namespace bwidgets { int w; int h; - - [[nodiscard]] inline auto operator-() const noexcept -> Size - { - return {-w, -h}; - } - [[nodiscard]] inline auto operator+(const Size& s) const noexcept -> Size - { - return {w + s.w, h + s.h}; - } - [[nodiscard]] inline auto operator-(const Size& s) const noexcept -> Size - { - return {w - s.w, h - s.h}; - } - - template - [[nodiscard]] inline auto operator*(N a) const noexcept -> Size - { - return {a * w, a * h}; - } }; + + [[nodiscard]] inline auto operator+(Size a, Size b) noexcept -> Size + { + return {a.w + b.w, a.h + b.h}; + } + + [[nodiscard]] inline auto operator-(Size a, Size b) noexcept -> Size + { + return {a.w - b.w, a.h - b.h}; + } + + template + [[nodiscard]] inline auto operator*(Size a, N b) noexcept -> Size + { + return {a.w * b, a.h * b}; + } + + template + [[nodiscard]] inline auto operator*(N a, Size b) noexcept -> Size + { + return b * a; + } } #endif