Function emath::clamp [−][src]
pub fn clamp<T>(x: T, range: RangeInclusive<T>) -> T where
T: Copy + PartialOrd,
👎 Deprecated:
Use f32::clamp instead
Expand description
Returns range.start()
if x <= range.start()
,
returns range.end()
if x >= range.end()
and returns x
elsewhen.