From af2b8e55aedc6aea0d1fb4951f44d3c1b4502373 Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Wed, 15 Mar 2023 22:28:55 +0000 Subject: [PATCH] init last if empty --- src/render.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/render.rs b/src/render.rs index ed8a7cd..e86f1b0 100644 --- a/src/render.rs +++ b/src/render.rs @@ -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> = data.iter().zip(&self.last).map(|(d, l)| d.lerp(l)).collect();