sdl/rect: Add pos() and size() returning points {x,y} and {w,h}

This commit is contained in:
Tommy 2022-07-19 23:31:32 +12:00
parent 2da7515722
commit d58829e129

View File

@ -60,6 +60,10 @@ public:
: SDL_Rect{pos.x, pos.y, size.x, size.y}
{}
// subcomponent access
point pos() const { return {x, y}; }
point size() const { return {w, h}; }
// Comparisons
bool operator==(const rect& r) const;
bool operator==(const SDL_Rect& r) const;