Skip to main content

ease_f32

Function ease_f32 

Source
pub fn ease_f32(ease: &impl Easing, p: f32) -> f32
Expand description

p (0 to 1; clamped, not a number counts as 0) eased by ease: turned into 1/65536, eased by the integer curve and turned back. A curve that overshoots (Back, Elastic) gives values below 0 and above 1.

use shuyi_core::{Ease, Family};
use shuyi_ui::ease::ease_f32;

assert_eq!(ease_f32(&Ease::Smooth, 0.5), 0.5);
assert!(ease_f32(&Ease::Out(Family::Back), 0.6) > 1.0);