summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-10-08 16:21:45 +0200
committerGitHub <noreply@github.com>2019-10-08 16:21:45 +0200
commit106e21fd5f85a861a692db229ee69a6ec31fe562 (patch)
treece63706ab1b9fda81ff88e5dc9c2d11a1fe3b341 /core
parentabd81dcb73767a91c07bacefcddab05a600bae49 (diff)
parenta681c90009a7314153ef9102a334b16b3b4ec1ef (diff)
Merge pull request #32478 from AlexHolly/fix-rect2-encloses
Make Rect2.encloses return true on same size
Diffstat (limited to 'core')
-rw-r--r--core/math/rect2.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/rect2.h b/core/math/rect2.h
index d636aa223f..f58756ee40 100644
--- a/core/math/rect2.h
+++ b/core/math/rect2.h
@@ -99,8 +99,8 @@ struct Rect2 {
inline bool encloses(const Rect2 &p_rect) const {
return (p_rect.position.x >= position.x) && (p_rect.position.y >= position.y) &&
- ((p_rect.position.x + p_rect.size.x) < (position.x + size.x)) &&
- ((p_rect.position.y + p_rect.size.y) < (position.y + size.y));
+ ((p_rect.position.x + p_rect.size.x) <= (position.x + size.x)) &&
+ ((p_rect.position.y + p_rect.size.y) <= (position.y + size.y));
}
_FORCE_INLINE_ bool has_no_area() const {