DNA: Add C++ comparison operator to rcti

This commit is contained in:
Sergey Sharybin
2023-07-20 11:18:11 +02:00
committed by Sergey Sharybin
parent 1c6c05ea7e
commit 032bcd50f8

View File

@@ -63,6 +63,17 @@ typedef struct vec4d {
typedef struct rcti {
int xmin, xmax;
int ymin, ymax;
#ifdef __cplusplus
inline bool operator==(const rcti &other) const
{
return xmin == other.xmin && xmax == other.xmax && ymin == other.ymin && ymax == other.ymax;
}
inline bool operator!=(const rcti &other) const
{
return !(*this == other);
}
#endif
} rcti;
/** float rectangle. */