From c2226fa9d13babf20022668269ae9537010c3957 Mon Sep 17 00:00:00 2001 From: Dander7BD Date: Wed, 19 Feb 2014 15:47:02 +0100 Subject: [PATCH] Clamp fixed WTF!? I'm 100% positive that I already did this fix. WTF!? --- Code/Misc/Utilities/Utilities.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Code/Misc/Utilities/Utilities.h b/Code/Misc/Utilities/Utilities.h index c259a845..b97d62d7 100644 --- a/Code/Misc/Utilities/Utilities.h +++ b/Code/Misc/Utilities/Utilities.h @@ -337,7 +337,11 @@ namespace Utility template 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 inline ValueType Average( const ValueType &valueA, const ValueType &valueB )