summaryrefslogtreecommitdiff
path: root/libs/ui/Rect.cpp
diff options
context:
space:
mode:
author Xin Li <delphij@google.com> 2019-09-05 16:53:28 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-09-05 16:53:28 +0000
commitb653dd0a088f3be9d0fccd3d2099b3f8ab63ca2c (patch)
treea3796f67d19deece6118e60d2faebde9499ce083 /libs/ui/Rect.cpp
parent0bc2361309d705f8c7f7766f1912fd0f7035d199 (diff)
parent9c724d78b9f2e00a7d4de3bfd2c65f6226fa8529 (diff)
Merge "DO NOT MERGE - Merge Android 10 into master"
Diffstat (limited to 'libs/ui/Rect.cpp')
-rw-r--r--libs/ui/Rect.cpp8
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;