mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 12:09:36 +00:00
Refactoring, dialog work
This commit is contained in:
@@ -26,6 +26,8 @@ struct Rect
|
||||
bool IsValid() const;
|
||||
Rect Intersect(const Rect &rect) const;
|
||||
Rect MakeValid() const;
|
||||
Rect operator-(const Point &point) const;
|
||||
Rect operator+(const Point &point) const;
|
||||
|
||||
static Rect Create(int16_t top, int16_t left, int16_t bottom, int16_t right);
|
||||
static Rect CreateFromPoints(const Point &topLeft, const Point &bottomRight);
|
||||
@@ -152,6 +154,16 @@ inline Rect Rect::MakeValid() const
|
||||
return result;
|
||||
}
|
||||
|
||||
inline Rect Rect::operator-(const Point &point) const
|
||||
{
|
||||
return Rect::Create(this->top - point.v, this->left - point.h, this->bottom - point.v, this->right - point.h);
|
||||
}
|
||||
|
||||
inline Rect Rect::operator+(const Point &point) const
|
||||
{
|
||||
return Rect::Create(this->top + point.v, this->left + point.h, this->bottom + point.v, this->right + point.h);
|
||||
}
|
||||
|
||||
inline Rect Rect::Create(int16_t top, int16_t left, int16_t bottom, int16_t right)
|
||||
{
|
||||
Rect result;
|
||||
|
||||
Reference in New Issue
Block a user