Refactoring, dialog work

This commit is contained in:
elasota
2019-12-31 02:42:20 -05:00
parent 04a955213c
commit 84e4f9fb0b
26 changed files with 817 additions and 271 deletions

View File

@@ -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;