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

`Rect2(I)`
This commit is contained in:
A Thousand Ships 2024-01-16 19:27:03 +01:00
parent 107f2961cc
commit 227a165ce4
No known key found for this signature in database
GPG Key ID: 2033189A662F8BD7
3 changed files with 7 additions and 7 deletions

View File

@ -98,11 +98,11 @@ namespace Godot
Vector3 dstMax = with._position + with._size; Vector3 dstMax = with._position + with._size;
return srcMin.X <= dstMin.X && return srcMin.X <= dstMin.X &&
srcMax.X > dstMax.X && srcMax.X >= dstMax.X &&
srcMin.Y <= dstMin.Y && srcMin.Y <= dstMin.Y &&
srcMax.Y > dstMax.Y && srcMax.Y >= dstMax.Y &&
srcMin.Z <= dstMin.Z && srcMin.Z <= dstMin.Z &&
srcMax.Z > dstMax.Z; srcMax.Z >= dstMax.Z;
} }
/// <summary> /// <summary>

View File

@ -123,8 +123,8 @@ namespace Godot
public readonly bool Encloses(Rect2 b) public readonly bool Encloses(Rect2 b)
{ {
return b._position.X >= _position.X && b._position.Y >= _position.Y && return b._position.X >= _position.X && b._position.Y >= _position.Y &&
b._position.X + b._size.X < _position.X + _size.X && b._position.X + b._size.X <= _position.X + _size.X &&
b._position.Y + b._size.Y < _position.Y + _size.Y; b._position.Y + b._size.Y <= _position.Y + _size.Y;
} }
/// <summary> /// <summary>

View File

@ -113,8 +113,8 @@ namespace Godot
public readonly bool Encloses(Rect2I b) public readonly bool Encloses(Rect2I b)
{ {
return b._position.X >= _position.X && b._position.Y >= _position.Y && return b._position.X >= _position.X && b._position.Y >= _position.Y &&
b._position.X + b._size.X < _position.X + _size.X && b._position.X + b._size.X <= _position.X + _size.X &&
b._position.Y + b._size.Y < _position.Y + _size.Y; b._position.Y + b._size.Y <= _position.Y + _size.Y;
} }
/// <summary> /// <summary>