diff --git a/include/blah/math/spatial.h b/include/blah/math/spatial.h index 6cdb983..0c92ee4 100644 --- a/include/blah/math/spatial.h +++ b/include/blah/math/spatial.h @@ -204,6 +204,7 @@ namespace Blah constexpr Rect scale(T s) const; constexpr Rect scale(T sx, T sy) const; constexpr Rect inflate(T amount) const; + constexpr Rect inflate(T amount_x, T amount_y) const; // Rect Sectors: // 0101 0100 0110 @@ -794,6 +795,11 @@ namespace Blah return Rect(x - amount, y - amount, w + amount * 2, h + amount * 2); } + template + constexpr Rect Rect::inflate(T amount_x, T amount_y) const { + return Rect(x - amount_x, y - amount_y, w + amount_x * 2, h + amount_y * 2); + } + template constexpr u8 Rect::get_sector(const Vec2& pt) const {