diff options
| author | 2019-09-04 13:34:06 -0700 | |
|---|---|---|
| committer | 2019-09-04 13:34:06 -0700 | |
| commit | 9c724d78b9f2e00a7d4de3bfd2c65f6226fa8529 (patch) | |
| tree | a3796f67d19deece6118e60d2faebde9499ce083 /libs/ui/Rect.cpp | |
| parent | 0bc2361309d705f8c7f7766f1912fd0f7035d199 (diff) | |
| parent | 638c07856510784987e81ba0b026780850bf5775 (diff) | |
DO NOT MERGE - Merge Android 10 into master
Bug: 139893257
Change-Id: I0b8ce4715e111f1378ddada95d746b1788645a6d
Diffstat (limited to 'libs/ui/Rect.cpp')
| -rw-r--r-- | libs/ui/Rect.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/ui/Rect.cpp b/libs/ui/Rect.cpp index d8702e5755..13fed3a239 100644 --- a/libs/ui/Rect.cpp +++ b/libs/ui/Rect.cpp @@ -72,6 +72,14 @@ Rect& Rect::offsetBy(int32_t x, int32_t y) { return *this; } +Rect& Rect::inset(int32_t _left, int32_t _top, int32_t _right, int32_t _bottom) { + this->left += _left; + this->top += _top; + this->right -= _right; + this->bottom -= _bottom; + return *this; +} + const Rect Rect::operator +(const Point& rhs) const { const Rect result(left + rhs.x, top + rhs.y, right + rhs.x, bottom + rhs.y); return result; |