summaryrefslogtreecommitdiffstats
path: root/src/Globals.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Globals.h')
-rw-r--r--src/Globals.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Globals.h b/src/Globals.h
index 7ee045130..e4737a98a 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -235,11 +235,11 @@ public:
-/** Clamp a_X to the specified range. */
+/** Clamp X to the specified range. */
template <typename T>
-T Clamp(T a_X, T a_Min, T a_Max)
+T Clamp(T a_Value, T a_Min, T a_Max)
{
- return std::min(std::max(a_X, a_Min), a_Max);
+ return (a_Value < a_Min) ? a_Min : ((a_Value > a_Max) ? a_Max : a_Value);
}