diff options
author | Mathias Agopian <mathias@google.com> | 2012-05-13 20:02:04 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2012-05-13 20:02:04 -0700 |
commit | b82203a6601728a507bc3e7d5b2b042356004aae (patch) | |
tree | 5527409b71b50363824a9c945ad8a30ea837d3bc /include/ui | |
parent | b194ec926bf3fb3c546244b135f602ceb3a0a6b0 (diff) | |
download | frameworks_native-b82203a6601728a507bc3e7d5b2b042356004aae.zip frameworks_native-b82203a6601728a507bc3e7d5b2b042356004aae.tar.gz frameworks_native-b82203a6601728a507bc3e7d5b2b042356004aae.tar.bz2 |
minor Rect.h cleanup
add getBounds(), getWidth(), getHeight(), width() and height()
are kept for backward compatibility.
Change-Id: I83837abf17dc2f8bded1beff73430e8c7d9bbdb3
Diffstat (limited to 'include/ui')
-rw-r--r-- | include/ui/Rect.h | 11 |
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; |