Skip to content

Commit

Permalink
fix: corrected thorvg canvas sync
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tinyjin committed Sep 4, 2024
1 parent 4fd6b2c commit c4b917d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dotlottie-rs/src/lottie_renderer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c4b917d

Please sign in to comment.