Refined Math.Clamp.

This commit is contained in:
Richard Davey 2017-09-20 16:51:15 +01:00
parent 6aae306aa0
commit 04e54efe43

View file

@ -9,18 +9,7 @@
*/
var Clamp = function (v, min, max)
{
if (v < min)
{
return min;
}
else if (max < v)
{
return max;
}
else
{
return v;
}
return Math.max(min, Math.min(max, value));
};
module.exports = Clamp;