Common/Rectangle: Make it work with float types

This commit is contained in:
Connor McLaughlin 2020-09-13 00:04:57 +10:00
parent 2b4568df6a
commit 84b0522abc

View file

@ -10,11 +10,8 @@ namespace Common {
template<typename T> template<typename T>
struct Rectangle struct Rectangle
{ {
enum : T static constexpr T InvalidMinCoord = std::numeric_limits<T>::max();
{ static constexpr T InvalidMaxCoord = std::numeric_limits<T>::min();
InvalidMinCoord = std::numeric_limits<T>::max(),
InvalidMaxCoord = std::numeric_limits<T>::min()
};
/// Default constructor - initializes to an invalid coordinate range suitable for including points. /// Default constructor - initializes to an invalid coordinate range suitable for including points.
constexpr Rectangle() : left(InvalidMinCoord), top(InvalidMinCoord), right(InvalidMaxCoord), bottom(InvalidMaxCoord) constexpr Rectangle() : left(InvalidMinCoord), top(InvalidMinCoord), right(InvalidMaxCoord), bottom(InvalidMaxCoord)