From 54b6cfa9a9e5b861a9930af873580d6dc20f773c Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Tue, 21 Oct 2008 07:00:00 -0700 Subject: Initial Contribution --- libs/ui/Rect.cpp | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 libs/ui/Rect.cpp (limited to 'libs/ui/Rect.cpp') diff --git a/libs/ui/Rect.cpp b/libs/ui/Rect.cpp new file mode 100644 index 0000000..99e68bb --- /dev/null +++ b/libs/ui/Rect.cpp @@ -0,0 +1,86 @@ +/* + * Rect.cpp + * Android + * + * Created on 10/14/05. + * Copyright 2005 The Android Open Source Project + * + */ + +#include + +namespace android { + +inline int min(int a, int b) { + return (ab) ? a : b; +} + +void Rect::makeInvalid() { + left = 0; + top = 0; + right = -1; + bottom = -1; +} + +bool Rect::operator < (const Rect& rhs) const +{ + if (topleft = max(left, with.left); + result->top = max(top, with.top); + result->right = min(right, with.right); + result->bottom = min(bottom, with.bottom); + return !(result->isEmpty()); +} + +}; // namespace android -- cgit v1.1