diff --git a/src/util.rs b/src/util.rs index 64594ce..7669d70 100644 --- a/src/util.rs +++ b/src/util.rs @@ -42,6 +42,15 @@ impl Smoother { self.done = false; } + #[inline] + pub fn current(&self) -> f32 { + if self.done { + self.target + } else { + self.value + } + } + #[inline] pub fn next(&mut self) -> f32 { //d// println!("NEXT: count={}, value={:6.3} inc={:6.4}",