mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-01 00:23:35 +00:00
Rename Rect::inflate() -> enlarge() and Rect::deflate -> shrink().
This commit is contained in:
parent
2baa342a65
commit
7273b95b68
@ -155,7 +155,7 @@ Rect& Rect::inflate(const Size& delta)
|
||||
return *this;
|
||||
}
|
||||
|
||||
Rect& Rect::inflate(const Border& br)
|
||||
Rect& Rect::enlarge(const Border& br)
|
||||
{
|
||||
x -= br.left();
|
||||
y -= br.top();
|
||||
@ -164,15 +164,6 @@ Rect& Rect::inflate(const Border& br)
|
||||
return *this;
|
||||
}
|
||||
|
||||
Rect& Rect::deflate(const Border& br)
|
||||
{
|
||||
x += br.left();
|
||||
y += br.top();
|
||||
w -= br.left() + br.right();
|
||||
h -= br.top() + br.bottom();
|
||||
return *this;
|
||||
}
|
||||
|
||||
Rect& Rect::enlarge(int unit)
|
||||
{
|
||||
x -= unit;
|
||||
@ -182,6 +173,15 @@ Rect& Rect::enlarge(int unit)
|
||||
return *this;
|
||||
}
|
||||
|
||||
Rect& Rect::shrink(const Border& br)
|
||||
{
|
||||
x += br.left();
|
||||
y += br.top();
|
||||
w -= br.left() + br.right();
|
||||
h -= br.top() + br.bottom();
|
||||
return *this;
|
||||
}
|
||||
|
||||
Rect& Rect::shrink(int unit)
|
||||
{
|
||||
x += unit;
|
||||
@ -244,24 +244,24 @@ Rect Rect::createIntersect(const Rect& rc) const
|
||||
|
||||
const Rect& Rect::operator+=(const Border& br)
|
||||
{
|
||||
inflate(br);
|
||||
enlarge(br);
|
||||
return *this;
|
||||
}
|
||||
|
||||
const Rect& Rect::operator-=(const Border& br)
|
||||
{
|
||||
deflate(br);
|
||||
shrink(br);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Rect Rect::operator+(const Border& br) const
|
||||
{
|
||||
return Rect(*this).inflate(br);
|
||||
return Rect(*this).enlarge(br);
|
||||
}
|
||||
|
||||
Rect Rect::operator-(const Border& br) const
|
||||
{
|
||||
return Rect(*this).deflate(br);
|
||||
return Rect(*this).shrink(br);
|
||||
}
|
||||
|
||||
bool Rect::operator==(const Rect& rc) const
|
||||
|
@ -78,11 +78,11 @@ public:
|
||||
Rect& offset(const Point& delta);
|
||||
Rect& inflate(int dw, int dh);
|
||||
Rect& inflate(const Size& delta);
|
||||
Rect& inflate(const Border& br);
|
||||
Rect& deflate(const Border& br);
|
||||
|
||||
Rect& enlarge(int unit);
|
||||
Rect& enlarge(const Border& br);
|
||||
Rect& shrink(int unit);
|
||||
Rect& shrink(const Border& br);
|
||||
|
||||
// Returns true if this rectangle encloses the pt point.
|
||||
bool contains(const Point& pt) const;
|
||||
|
Loading…
Reference in New Issue
Block a user