[C#] Fix Encloses failing on shared upper bound for AABB and

`Rect2(I)`

(cherry picked from commit 227a165ce4)
This commit is contained in:
A Thousand Ships 2024-01-16 19:27:03 +01:00 committed by Yuri Sizov
parent ad57a98eb0
commit e070bbc77e
3 changed files with 7 additions and 7 deletions

View File

@ -95,11 +95,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;
}
/// <summary>

View File

@ -120,8 +120,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;
}
/// <summary>

View File

@ -110,8 +110,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;
}
/// <summary>