From 6c5745c4bf92a5f897314bae2f415e8b86a39f9a Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Tue, 3 Sep 2013 14:51:13 +0200 Subject: [PATCH] FloatRect: add implicit IntRect conversion --- src/etc-internal.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/etc-internal.h b/src/etc-internal.h index 25f47c6..f223d81 100644 --- a/src/etc-internal.h +++ b/src/etc-internal.h @@ -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); }