Clamp fixed

This commit is contained in:
Dander7BD 2014-02-18 11:06:11 +01:00
parent fc19938f1b
commit c8c0bb9bc4
1 changed files with 5 additions and 1 deletions

View File

@ -337,7 +337,11 @@ namespace Utility
template<typename ValueType>
inline ValueType Clamp( const ValueType &value, const ValueType &min, const ValueType &max )
{ return value < min ? Max( value, max ) : min; }
{
if( value < min ) return min;
if( value > max ) return max;
return value;
}
template<typename ValueType>
inline ValueType Average( const ValueType &valueA, const ValueType &valueB )