From 9fced9b8780127dc9896471adb1a6e4d42e06a88 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 14 Feb 2022 16:30:26 -0500 Subject: [PATCH] Add Rect::getWidth() and getHeight(). --- include/math.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/math.hpp b/include/math.hpp index 7b55a7ae..601aaaeb 100644 --- a/include/math.hpp +++ b/include/math.hpp @@ -356,6 +356,12 @@ struct Rect { float getBottom() const { return (size.y == INFINITY) ? INFINITY : (pos.y + size.y); } + float getWidth() const { + return size.x; + } + float getHeight() const { + return size.y; + } /** Returns the center point of the rectangle. Returns a NaN coordinate if pos=-inf and size=inf. */