Tidy up size operators
@@ -14,7 +14,9 @@ namespace blit {
constexpr Size(int32_t w, int32_t h) : w(w), h(h) {}
inline Size& operator*= (const float a) { w = static_cast<int32_t>(w * a); h = static_cast<int32_t>(h * a); return *this; }
- inline Size operator / (const int a) { return Size(w / a, h / a);}
+ inline Size& operator/= (const float a) { w = static_cast<int32_t>(w / a); h = static_cast<int32_t>(h / a); return *this; }
+ inline Size& operator*= (const int a) { w = static_cast<int32_t>(w * a); h = static_cast<int32_t>(h * a); return *this; }
+ inline Size& operator/= (const int a) { w = static_cast<int32_t>(w / a); h = static_cast<int32_t>(h / a); return *this; }
bool empty() { return w <= 0 || h <= 0; }
@@ -26,6 +28,9 @@ namespace blit {
};
+ inline Size operator/ (Size lhs, const float a) { lhs /= a; return lhs;}
+ inline Size operator/ (Size lhs, const int a) { lhs /= a; return lhs; }
inline Size operator* (Size lhs, const float a) { lhs *= a; return lhs; }
+ inline Size operator* (Size lhs, const int a) { lhs *= a; return lhs; }
}
\ No newline at end of file
