From c79b7c8ee633f6e86d7ca3bc808a611a7e3ba898 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 18 Mar 2020 15:18:44 +0100 Subject: [PATCH] New helper for testing if rect inside another rect --- radio/src/thirdparty/libopenui/src/libopenui_types.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/radio/src/thirdparty/libopenui/src/libopenui_types.h b/radio/src/thirdparty/libopenui/src/libopenui_types.h index 683829f66..a643b2384 100644 --- a/radio/src/thirdparty/libopenui/src/libopenui_types.h +++ b/radio/src/thirdparty/libopenui/src/libopenui_types.h @@ -63,6 +63,11 @@ struct rect_t { return (x >= this->x && x < this->x + this->w && y >= this->y && y < this->y + this->h); } + + bool contains(const rect_t & other) const + { + return left() <= other.left() && right() >= other.right() && top() <= other.top() && bottom() >= other.bottom(); + } }; typedef uint32_t LcdFlags;