From 46bb523db7114ee38b14172111949b2325131126 Mon Sep 17 00:00:00 2001 From: Chaosus89 Date: Mon, 16 Sep 2019 09:49:04 +0300 Subject: [Mono] Corrected rectangle intersection --- modules/mono/glue/Managed/Files/Rect2.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/mono/glue') 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; -- cgit v1.2.3