init last if empty

This commit is contained in:
Andre Henriques 2023-03-15 22:28:55 +00:00
parent 02f261a85a
commit af2b8e55ae

View File

@ -282,6 +282,10 @@ impl Render {
if self.last.is_empty() || !self.last.clone().iter().eq(data.clone().iter()) {
if self.last.len() == 0 {
self.last = data.clone();
}
let lerp_data: Vec<RGB<u8>> = data.iter().zip(&self.last).map(|(d, l)| d.lerp(l)).collect();