diff options
author | Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com> | 2019-09-16 18:11:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-16 18:11:19 +0200 |
commit | 3e782c78ae46dd3452e7a61a52c65a69f09b8413 (patch) | |
tree | fa6230a53e1f9424134c4809d67b4dbd2f33c202 /modules/mono/glue | |
parent | 24e1039eb6fe32115e8d1a62a84965e9be19a2ed (diff) | |
parent | 46bb523db7114ee38b14172111949b2325131126 (diff) |
Merge pull request #32161 from Chaosus/fix_rect
[Mono] Corrected rectangle intersection
Diffstat (limited to 'modules/mono/glue')
-rw-r--r-- | modules/mono/glue/Managed/Files/Rect2.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/mono/glue/Managed/Files/Rect2.cs b/modules/mono/glue/Managed/Files/Rect2.cs index f3dc9d8490..99542d0c0a 100644 --- a/modules/mono/glue/Managed/Files/Rect2.cs +++ b/modules/mono/glue/Managed/Files/Rect2.cs @@ -157,13 +157,13 @@ namespace Godot public bool Intersects(Rect2 b) { - if (_position.x > b._position.x + b._size.x) + if (_position.x >= b._position.x + b._size.x) return false; - if (_position.x + _size.x < b._position.x) + if (_position.x + _size.x <= b._position.x) return false; - if (_position.y > b._position.y + b._size.y) + if (_position.y >= b._position.y + b._size.y) return false; - if (_position.y + _size.y < b._position.y) + if (_position.y + _size.y <= b._position.y) return false; return true; |