mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Lib fixes
This commit is contained in:
parent
36d2bb69f5
commit
11bc782835
2 changed files with 9 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -82,7 +82,7 @@ namespace System
|
|||
}
|
||||
}
|
||||
|
||||
class RefCounted<T> : IRefCounted where T : class, delete
|
||||
class RefCounted<T> : IRefCounted where T : delete
|
||||
{
|
||||
public T mVal;
|
||||
public int mRefCount = 1;
|
||||
|
@ -178,7 +178,7 @@ namespace System
|
|||
public virtual T Detach()
|
||||
{
|
||||
var val = mVal;
|
||||
mVal = null;
|
||||
mVal = default;
|
||||
return val;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue