From 62b9a6acd59a8046598b61a367d5ae041cee8919 Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Sun, 19 Mar 2023 09:31:02 +0000 Subject: [PATCH] added more logging to lerp to debug the flash --- src/render.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/render.rs b/src/render.rs index 030f733..f2afba2 100644 --- a/src/render.rs +++ b/src/render.rs @@ -317,7 +317,7 @@ impl Render { let lerp_data: Vec> = data.iter().zip(&self.last).map(|(d, l)| l.lerp(d, delta as f64)).collect(); - //println!("d:{:?}\n l:{:?}", data, lerp_data); + println!("d:{:?}\n l:{:?}", data[25], lerp_data[25]); let to_set_data: Vec> = rgbs_f64_to_u8(&lerp_data); @@ -380,15 +380,11 @@ impl Lerp for f64 { let lerped = self + change; - if *other != self && diff != 0.0 { - println!("c: {} target:{} lerp: {} move: {}", self, other, lerped, change); - } - if (*other - self).abs() < 2.0 && diff != 0.0 { - return *other; + *other + } else { + lerped } - - lerped } }