summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-05-14 16:09:32 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-14 16:09:32 -0700
commit9cab4ca1ca74068e50192296badd0ae7a61f3927 (patch)
tree0bbfdb0dddd3d4a42ea3d117f849d98964391f78
parent05f257febc28a4d891dde6f66a431631c58815d1 (diff)
parentb82203a6601728a507bc3e7d5b2b042356004aae (diff)
downloadframeworks_native-9cab4ca1ca74068e50192296badd0ae7a61f3927.zip
frameworks_native-9cab4ca1ca74068e50192296badd0ae7a61f3927.tar.gz
frameworks_native-9cab4ca1ca74068e50192296badd0ae7a61f3927.tar.bz2
Merge "minor Rect.h cleanup" into jb-dev
-rw-r--r--include/ui/Rect.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/ui/Rect.h b/include/ui/Rect.h
index 308da7b..c2c2675 100644
--- a/include/ui/Rect.h
+++ b/include/ui/Rect.h
@@ -65,15 +65,22 @@ public:
}
// rectangle's width
- inline int32_t width() const {
+ inline int32_t getWidth() const {
return right-left;
}
// rectangle's height
- inline int32_t height() const {
+ inline int32_t getHeight() const {
return bottom-top;
}
+ inline Rect getBounds() const {
+ return Rect(right-left, bottom-top);
+ }
+
+ inline int32_t width() const { return getWidth(); }
+ inline int32_t height() const { return getHeight(); }
+
void setLeftTop(const Point& lt) {
left = lt.x;
top = lt.y;