SHARE
TWEET

clamp(val:Number, min:Number, max:Number):Number

ulfben Mar 6th, 2016 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private function clamp(val:Number, min:Number, max:Number):Number{                     
  2.     return (val > max) ? max : ((val < min) ? min : val); //= Math.max(min, Math.min(max, val))
  3. }
RAW Paste Data
Top