FloatRect: add implicit IntRect conversion
This commit is contained in:
parent
73812e957e
commit
6c5745c4bf
|
@ -183,6 +183,11 @@ struct FloatRect
|
|||
: x(r.x), y(r.y), w(r.w), h(r.h)
|
||||
{}
|
||||
|
||||
operator IntRect() const
|
||||
{
|
||||
return IntRect(x, y, w, h);
|
||||
}
|
||||
|
||||
Vec2 topLeft() const { return Vec2(x, y); }
|
||||
Vec2 bottomLeft() const { return Vec2(x, y+h); }
|
||||
Vec2 topRight() const { return Vec2(x+w, y); }
|
||||
|
|
Loading…
Reference in New Issue