From e42467fe3af5c1970a8b3890f7aa04b7dd7408ec Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 9 Feb 2024 08:37:40 +0100 Subject: [PATCH] POrted: [C#] Fix Encloses failing on shared upper bound for AABB and Rect2. - AThousandShips https://github.com/godotengine/godot/commit/ee4396809c5b557c1c429d4ae7b2c34c34c06e8e --- glue/GodotSharp/GodotSharp/Core/AABB.cs | 6 +++--- glue/GodotSharp/GodotSharp/Core/Rect2.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/glue/GodotSharp/GodotSharp/Core/AABB.cs b/glue/GodotSharp/GodotSharp/Core/AABB.cs index ba4f6cb..856c6d2 100644 --- a/glue/GodotSharp/GodotSharp/Core/AABB.cs +++ b/glue/GodotSharp/GodotSharp/Core/AABB.cs @@ -91,11 +91,11 @@ namespace Godot Vector3 dstMax = with._position + with._size; return srcMin.x <= dstMin.x && - srcMax.x > dstMax.x && + srcMax.x >= dstMax.x && srcMin.y <= dstMin.y && - srcMax.y > dstMax.y && + srcMax.y >= dstMax.y && srcMin.z <= dstMin.z && - srcMax.z > dstMax.z; + srcMax.z >= dstMax.z; } /// diff --git a/glue/GodotSharp/GodotSharp/Core/Rect2.cs b/glue/GodotSharp/GodotSharp/Core/Rect2.cs index 3486321..ca85a8e 100644 --- a/glue/GodotSharp/GodotSharp/Core/Rect2.cs +++ b/glue/GodotSharp/GodotSharp/Core/Rect2.cs @@ -112,8 +112,8 @@ namespace Godot public bool Encloses(Rect2 b) { return b._position.x >= _position.x && b._position.y >= _position.y && - b._position.x + b._size.x < _position.x + _size.x && - b._position.y + b._size.y < _position.y + _size.y; + b._position.x + b._size.x <= _position.x + _size.x && + b._position.y + b._size.y <= _position.y + _size.y; } ///