diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2022-08-11 16:12:27 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2022-10-08 13:25:08 +0800 |
commit | 5da515773d8edec988b7523ea97cdfd54c3fd16c (patch) | |
tree | 1107edc8f9bcff011b9bf789cf0e54bc9d46c28d /core/math/rect2.cpp | |
parent | 18177828ad97286ca88cbdcfb763c967858d051b (diff) | |
download | redot-engine-5da515773d8edec988b7523ea97cdfd54c3fd16c.tar.gz |
Add `is_finite` method for checking built-in types
Diffstat (limited to 'core/math/rect2.cpp')
-rw-r--r-- | core/math/rect2.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/math/rect2.cpp b/core/math/rect2.cpp index 9e78ead816..facf4eb3c4 100644 --- a/core/math/rect2.cpp +++ b/core/math/rect2.cpp @@ -38,6 +38,10 @@ bool Rect2::is_equal_approx(const Rect2 &p_rect) const { return position.is_equal_approx(p_rect.position) && size.is_equal_approx(p_rect.size); } +bool Rect2::is_finite() const { + return position.is_finite() && size.is_finite(); +} + bool Rect2::intersects_segment(const Point2 &p_from, const Point2 &p_to, Point2 *r_pos, Point2 *r_normal) const { #ifdef MATH_CHECKS if (unlikely(size.x < 0 || size.y < 0)) { |