(Box|Rect) Fixed Contains method excluding edge vectors

Former-commit-id: f3281ad9f7af268fceccfdb9d4f67ac0ac76b445
This commit is contained in:
Lynix 2015-03-19 12:49:08 +01:00
parent efa75ba349
commit 0363a1a8fa
2 changed files with 5 additions and 5 deletions

View File

@ -56,9 +56,9 @@ NzBox<T>::NzBox(const NzBox<U>& box)
template<typename T>
bool NzBox<T>::Contains(T X, T Y, T Z) const
{
return X >= x && X < x+width &&
Y >= y && Y < y+height &&
Z >= z && Z < z+depth;
return X >= x && X <= x+width &&
Y >= y && Y <= y+height &&
Z >= z && Z <= z+depth;
}
template<typename T>

View File

@ -50,8 +50,8 @@ NzRect<T>::NzRect(const NzRect<U>& rect)
template<typename T>
bool NzRect<T>::Contains(T X, T Y) const
{
return X >= x && X < x+width &&
Y >= y && Y < y+height;
return X >= x && X <= x+width &&
Y >= y && Y <= y+height;
}
template<typename T>