3 #define IMGUI_DEFINE_MATH_OPERATORS
5 #include <imgui_internal.h>
10 Rect(ImVec2 pos
, ImVec2 size
) : pos(pos
), size(size
) {}
11 Rect(float x
, float y
, float w
, float h
) : pos(x
, y
), size(w
, h
) {}
16 float top() const { return pos
.y
; }
17 float left() const { return pos
.x
; }
18 float bottom() const { return pos
.y
+ size
.y
; }
19 float right() const { return pos
.x
+ size
.x
; }
21 bool intersects(const Rect
&other
) {
22 return this->left() < other
.right() &&
23 this->right() > other
.left() &&
24 this->top() < other
.bottom() &&
25 this->bottom() > other
.top();
29 std::ostream
&operator<<(std::ostream
&os
, const ImVec2
&vec
);
30 std::ostream
&operator<<(std::ostream
&os
, const Rect
&rect
);