added more logging to lerp to debug the flash
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Andre Henriques 2023-03-19 09:31:02 +00:00
parent c56823eb31
commit 62b9a6acd5

View File

@ -317,7 +317,7 @@ impl Render {
let lerp_data: Vec<RGB<f64>> = data.iter().zip(&self.last).map(|(d, l)| l.lerp(d, delta as f64)).collect(); let lerp_data: Vec<RGB<f64>> = 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<RGB<u8>> = rgbs_f64_to_u8(&lerp_data); let to_set_data: Vec<RGB<u8>> = rgbs_f64_to_u8(&lerp_data);
@ -380,17 +380,13 @@ impl Lerp for f64 {
let lerped = self + change; 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 { if (*other - self).abs() < 2.0 && diff != 0.0 {
return *other; *other
} } else {
lerped lerped
} }
} }
}
impl Lerp for RGB<f64> { impl Lerp for RGB<f64> {
fn lerp(self, other: &Self, diff: f64) -> Self { fn lerp(self, other: &Self, diff: f64) -> Self {