1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-03 23:05:59 +02:00

Lib fixes

This commit is contained in:
Brian Fiete 2025-03-31 08:57:22 -04:00
parent 36d2bb69f5
commit 11bc782835
2 changed files with 9 additions and 3 deletions

View file

@ -212,6 +212,12 @@ namespace Beefy.geom
(y >= mY) && (y < mY + mHeight));
}
public bool ContainsInclusive(T x, T y)
{
return ((x >= mX) && (x <= mX + mWidth) &&
(y >= mY) && (y <= mY + mHeight));
}
public bool Contains(Point<T> pt)
{
return Contains(pt.x, pt.y);
@ -219,7 +225,7 @@ namespace Beefy.geom
public bool Contains(Self rect)
{
return Contains(rect.mX, rect.mY) && Contains(rect.mX + rect.mWidth, rect.mY + rect.mHeight);
return Contains(rect.mX, rect.mY) && ContainsInclusive(rect.mX + rect.mWidth, rect.mY + rect.mHeight);
}
public void Offset(T x, T y) mut