From 46ea7585631d0e6278739ab81df1dae61cb4ff09 Mon Sep 17 00:00:00 2001 From: Jinny You Date: Wed, 4 Sep 2024 18:13:47 +0900 Subject: [PATCH] fix: corrected thorvg canvas sync (#222) Ensure `thorvg_canvas_sync` is called before buffer changes. Additionally, the function should not disrupt subsequent code execution, regardless of its return value. Call the function without using the Rust try operator (`?`). Issue: #206 --- dotlottie-rs/src/lottie_renderer/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dotlottie-rs/src/lottie_renderer/mod.rs b/dotlottie-rs/src/lottie_renderer/mod.rs index a2df8bae..6763eebb 100644 --- a/dotlottie-rs/src/lottie_renderer/mod.rs +++ b/dotlottie-rs/src/lottie_renderer/mod.rs @@ -194,14 +194,14 @@ impl LottieRenderer { )); } + let _ = self.thorvg_canvas.sync(); + self.width = width; self.height = height; self.buffer .resize((self.width * self.height * 4) as usize, 0); - self.thorvg_canvas.sync()?; - self.thorvg_canvas .set_target( &mut self.buffer,