summaryrefslogtreecommitdiffstats
path: root/core/math/rect2.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-11-07 14:54:15 +0100
committerGitHub <noreply@github.com>2019-11-07 14:54:15 +0100
commit77816fea8bf6d05c749c9724bf1a566454d58aec (patch)
tree58a728cecde763e690d2b26685e6e43fbba838a8 /core/math/rect2.cpp
parentf0fc28f0fd7a3116483340d1dad5e7b7229337f6 (diff)
parent218f38c7ecdea970a5e82a48e7782077be4fc248 (diff)
downloadredot-engine-77816fea8bf6d05c749c9724bf1a566454d58aec.tar.gz
Merge pull request #32477 from aaronfranke/equal-approx-separate
Make is_equal_approx separate and make == exact again
Diffstat (limited to 'core/math/rect2.cpp')
-rw-r--r--core/math/rect2.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/math/rect2.cpp b/core/math/rect2.cpp
index fea128afbd..e31776672e 100644
--- a/core/math/rect2.cpp
+++ b/core/math/rect2.cpp
@@ -30,6 +30,11 @@
#include "core/math/transform_2d.h" // Includes rect2.h but Rect2 needs Transform2D
+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::intersects_segment(const Point2 &p_from, const Point2 &p_to, Point2 *r_pos, Point2 *r_normal) const {
real_t min = 0, max = 1;