From 227a165ce4ecf2c040263075ed4b23862519af6f Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Tue, 16 Jan 2024 19:27:03 +0100 Subject: [PATCH] [C#] Fix `Encloses` failing on shared upper bound for `AABB` and `Rect2(I)` --- modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs | 6 +++--- modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs | 4 ++-- modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs index 57b5b09ebbd..63af6ee6e8d 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs @@ -98,11 +98,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/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs index 71a35ab8094..cf4ac45a9f6 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs @@ -123,8 +123,8 @@ namespace Godot public readonly 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; } /// diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs index ef7e9eacd88..58560df0c51 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs @@ -113,8 +113,8 @@ namespace Godot public readonly bool Encloses(Rect2I 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; } ///