mirror of
https://github.com/NoelFB/blah.git
synced 2024-11-25 16:18:57 +08:00
added Rect::inflate(x, y)
This commit is contained in:
parent
cbb194e516
commit
05391f0b3d
|
@ -204,6 +204,7 @@ namespace Blah
|
||||||
constexpr Rect scale(T s) const;
|
constexpr Rect scale(T s) const;
|
||||||
constexpr Rect scale(T sx, T sy) const;
|
constexpr Rect scale(T sx, T sy) const;
|
||||||
constexpr Rect inflate(T amount) const;
|
constexpr Rect inflate(T amount) const;
|
||||||
|
constexpr Rect inflate(T amount_x, T amount_y) const;
|
||||||
|
|
||||||
// Rect Sectors:
|
// Rect Sectors:
|
||||||
// 0101 0100 0110
|
// 0101 0100 0110
|
||||||
|
@ -794,6 +795,11 @@ namespace Blah
|
||||||
return Rect(x - amount, y - amount, w + amount * 2, h + amount * 2);
|
return Rect(x - amount, y - amount, w + amount * 2, h + amount * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
constexpr Rect<T> Rect<T>::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<class T>
|
template<class T>
|
||||||
constexpr u8 Rect<T>::get_sector(const Vec2<T>& pt) const
|
constexpr u8 Rect<T>::get_sector(const Vec2<T>& pt) const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user