Fix [Box|Rect]::Contains including outer border points

This commit is contained in:
Jérôme Leclercq 2017-06-01 17:24:28 +02:00
parent 308f6d7448
commit 4f1d52b395
2 changed files with 5 additions and 5 deletions

View File

@ -133,9 +133,9 @@ namespace Nz
template<typename T> template<typename T>
bool Box<T>::Contains(T X, T Y, T Z) const bool Box<T>::Contains(T X, T Y, T Z) const
{ {
return X >= x && X <= x + width && return X >= x && X < x + width &&
Y >= y && Y <= y + height && Y >= y && Y < y + height &&
Z >= z && Z <= z + depth; Z >= z && Z < z + depth;
} }
/*! /*!

View File

@ -117,8 +117,8 @@ namespace Nz
template<typename T> template<typename T>
bool Rect<T>::Contains(T X, T Y) const bool Rect<T>::Contains(T X, T Y) const
{ {
return X >= x && X <= (x + width) && return X >= x && X < (x + width) &&
Y >= y && Y <= (y + height); Y >= y && Y < (y + height);
} }
/*! /*!