1 #ifndef LXGUI_GUI_BOUNDS2_HPP
2 #define LXGUI_GUI_BOUNDS2_HPP
4 #include "lxgui/gui_vector2.hpp"
5 #include "lxgui/lxgui.hpp"
25 void set(T l, T r, T t, T b) noexcept {
69 auto range_overlaps = [](T min1, T max1, T min2, T max2) {
70 return (min1 >= min2 && min1 < max2) || (min2 >= min1 && min2 < max1);
94 tmp.
right += offset.x;
103 tmp.
left += offset.x;
104 tmp.
right += offset.x;
113 tmp.
left -= offset.x;
114 tmp.
right -= offset.x;
158 template<
typename O,
typename T>
160 return stream <<
"(" <<
quad.top_left() <<
"), (" <<
quad.bottom_right() <<
")";
std::ostream & operator<<(std::ostream &stream, const color &c)
bounds2< T > operator/(const bounds2< T > &quad, T scale) noexcept
color operator+(const color &c1, const color &c2) noexcept
color operator*(const color &c1, const color &c2) noexcept
color operator-(const color &c1, const color &c2) noexcept
Holds 2D bounds of a region.
void set(T l, T r, T t, T b) noexcept
bool operator==(const bounds2< T > &quad) const
vector2< T > bottom_left() const noexcept
bool operator!=(const bounds2< T > &quad) const
static const bounds2 zero
bool contains(const vector2< T > &p) const
vector2< T > bottom_right() const noexcept
T height() const noexcept
constexpr bounds2(const vector2< T > ¢er, const vector2< T > &size) noexcept
vector2< T > top_right() const noexcept
constexpr bounds2(T l, T r, T t, T b) noexcept
constexpr bounds2()=default
vector2< T > dimensions() const noexcept
vector2< T > center() const noexcept
vector2< T > top_left() const noexcept
bool overlaps(const bounds2< T > &quad) const
Simple structure holding four vertices and a material.