From a410e190a49b6d78434ac3cee2df8f13800f1246 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Sat, 3 Dec 2005 14:12:10 +0000 Subject: [PATCH] Added rect_contains() git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15298 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/interface/clipping.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/headers/private/interface/clipping.h b/headers/private/interface/clipping.h index 11a2be3002..ed7cc2aa8f 100644 --- a/headers/private/interface/clipping.h +++ b/headers/private/interface/clipping.h @@ -126,6 +126,14 @@ point_in(const clipping_rect &rect, const BPoint &pt) } +static inline bool +rect_contains(const clipping_rect &rect, const clipping_rect &testRect) +{ + return rect.top <= testRect.top && rect.bottom >= testRect.bottom + && rect.left <= testRect.left && rect.right >= testRect.right; +} + + // Checks if the rect is valid static inline bool valid_rect(const clipping_rect &rect)