mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
Merge pull request #3191 from lioncash/rekt
MathUtil: Minor changes to Rectangle
This commit is contained in:
@ -117,19 +117,21 @@ double ApproximateReciprocal(double val);
|
||||
template<class T>
|
||||
struct Rectangle
|
||||
{
|
||||
T left;
|
||||
T top;
|
||||
T right;
|
||||
T bottom;
|
||||
T left{};
|
||||
T top{};
|
||||
T right{};
|
||||
T bottom{};
|
||||
|
||||
Rectangle()
|
||||
{ }
|
||||
constexpr Rectangle() = default;
|
||||
|
||||
Rectangle(T theLeft, T theTop, T theRight, T theBottom)
|
||||
constexpr Rectangle(T theLeft, T theTop, T theRight, T theBottom)
|
||||
: left(theLeft), top(theTop), right(theRight), bottom(theBottom)
|
||||
{ }
|
||||
{}
|
||||
|
||||
bool operator==(const Rectangle& r) { return left==r.left && top==r.top && right==r.right && bottom==r.bottom; }
|
||||
constexpr bool operator==(const Rectangle& r) const
|
||||
{
|
||||
return left == r.left && top == r.top && right == r.right && bottom == r.bottom;
|
||||
}
|
||||
|
||||
T GetWidth() const { return abs(right - left); }
|
||||
T GetHeight() const { return abs(bottom - top); }
|
||||
|
Reference in New Issue
Block a user