Skip to content

Commit

Permalink
fix: corrected thorvg canvas sync (#222)
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 authored Sep 4, 2024
1 parent 4fd6b2c commit 46ea758
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 46ea758

Please sign in to comment.