11 Real x; Real y; Real w; Real h;
12 Rect() = default; // Needed so we can fread/fwrite this struct
13 Rect(Real _x, Real _y, Real _w, Real _h) : x(_x), y(_y), w(_w), h(_h) {}
14 std::string Str() const
17 // float conversion needed because it is fucking impossible to get ostreams working with template classes
18 s << "{" << Float(x) << ", " << Float(y) << ", " << Float(w) << ", " << Float(h) << "}";
21 inline bool PointIn(Real pt_x, Real pt_y) const
23 if (pt_x < x) return false;
24 if (pt_y < y) return false;
25 if (pt_x > x + w) return false;
26 if (pt_y > y + h) return false;