Merge pull request #87264 from AThousandShips/aabb_fix_cs

[C#] Fix `Encloses` failing on shared upper bound for `AABB` and `Rect2(I)`
This commit is contained in:
Yuri Sizov 2024-01-17 18:53:22 +01:00
commit 66736398cd
3 changed files with 7 additions and 7 deletions

View file

@ -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;
}
/// <summary>

View file

@ -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;
}
/// <summary>

View file

@ -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;
}
/// <summary>