mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added isFinite() methods to Point and Rectangle.
This commit is contained in:
parent
5ce5d95064
commit
769c2f4b46
2 changed files with 6 additions and 0 deletions
|
|
@ -58,6 +58,9 @@ public:
|
|||
/** Returns true if the point is (0, 0). */
|
||||
bool isOrigin() const noexcept { return x == ValueType() && y == ValueType(); }
|
||||
|
||||
/** Returns true if the coordinates are finite values. */
|
||||
inline bool isFinite() const noexcept { return juce_isfinite(x) && juce_isfinite(y); }
|
||||
|
||||
/** Returns the point's x coordinate. */
|
||||
inline ValueType getX() const noexcept { return x; }
|
||||
|
||||
|
|
|
|||
|
|
@ -100,6 +100,9 @@ public:
|
|||
/** Returns true if the rectangle's width or height are zero or less */
|
||||
bool isEmpty() const noexcept { return w <= ValueType() || h <= ValueType(); }
|
||||
|
||||
/** Returns true if the rectangle's values are all finite numbers, i.e. not NaN or infinity. */
|
||||
inline bool isFinite() const noexcept { return pos.isFinite() && juce_isfinite(w) && juce_isfinite(h); }
|
||||
|
||||
/** Returns the x coordinate of the rectangle's left-hand-side. */
|
||||
inline ValueType getX() const noexcept { return pos.x; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue