Browse Source

Add Rect::getWidth() and getHeight().

tags/v2.1.0
Andrew Belt 2 years ago
parent
commit
9fced9b878
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      include/math.hpp

+ 6
- 0
include/math.hpp View File

@@ -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.
*/


Loading…
Cancel
Save