diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-03-13 06:44:04 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-03-13 06:44:04 +0100 |
| commit | b430026b7656173f78f62dfdab13fa705b2cc718 (patch) | |
| tree | 7dda6e2deea004449204754fc4fd7b27900c1dda /dev/Usr/LibCF/Foundation.cc | |
| parent | 9dbdbaabf24281eecdacd02dc82eb1828f4057a0 (diff) | |
TQ-23: Patch source code and leaving it for now.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Usr/LibCF/Foundation.cc')
| -rw-r--r-- | dev/Usr/LibCF/Foundation.cc | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/dev/Usr/LibCF/Foundation.cc b/dev/Usr/LibCF/Foundation.cc new file mode 100644 index 00000000..cb11287f --- /dev/null +++ b/dev/Usr/LibCF/Foundation.cc @@ -0,0 +1,48 @@ +/* ------------------------------------------- + + Copyright (C) 2024 Amlal El Mahrouss, all rights reserved + +------------------------------------------- */ + +#include <LibCF/Foundation.h> + +LibCF::CFRect::operator bool() +{ + return width > 0 && height > 0; +} + +/***********************************************************************************/ +/// @brief returns true if size matches. +/***********************************************************************************/ +BOOL LibCF::CFRect::SizeMatches(LibCF::CFRect& rect) noexcept +{ + return rect.height == height && rect.width == width; +} + +/***********************************************************************************/ +/// @brief returns true if position matches. +/***********************************************************************************/ +BOOL LibCF::CFRect::PositionMatches(LibCF::CFRect& rect) noexcept +{ + return rect.y == y && rect.x == x; +} + +/***********************************************************************************/ +/// @brief Check if point is within the current MLPoint. +/// @param point the current point to check. +/// @retval true if point is within this point. +/// @retval the validations have failed, false otherwise true. +/***********************************************************************************/ +BOOL LibCF::CFPoint::IsWithin(LibCF::CFPoint& withinOf) +{ + return x_1 >= withinOf.x_1 && x_2 <= (withinOf.x_2) && + y_1 >= withinOf.y_1 && y_2 <= (withinOf.y_2); +} + +/***********************************************************************************/ +/// @brief if Point object is correctly set up. +/***********************************************************************************/ +LibCF::CFPoint::operator bool() +{ + return x_1 > x_2 && y_1 > y_2; +}
\ No newline at end of file |
