Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🎸 theming #81

Merged
merged 12 commits into from
Mar 11, 2024
Prev Previous commit
Next Next commit
chore: 🤖 test out slots
theashraf committed Mar 4, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 080adbfa16cf62d772e8a496ab4a682613792050
1 change: 1 addition & 0 deletions demo-player/src/main.rs
Original file line number Diff line number Diff line change
@@ -248,6 +248,7 @@ fn main() {
autoplay: true,
segments: vec![10.0, 45.0],
background_color: 0xffffffff,
theme_id: "".to_string(),
});

lottie_player.load_animation_data(&string, WIDTH as u32, HEIGHT as u32);
2 changes: 1 addition & 1 deletion deps/modules/thorvg
Submodule thorvg updated 236 files
5 changes: 2 additions & 3 deletions dotlottie-rs/src/lottie_renderer/mod.rs
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ impl LottieRenderer {
width: u32,
height: u32,
) -> Result<(), LottieRendererError> {
self.thorvg_canvas.clear(true, false)?;
self.thorvg_canvas.clear(true)?;

self.width = width;
self.height = height;
@@ -109,7 +109,7 @@ impl LottieRenderer {
height: u32,
copy: bool,
) -> Result<(), LottieRendererError> {
self.thorvg_canvas.clear(true, false)?;
self.thorvg_canvas.clear(true)?;

self.width = width;
self.height = height;
@@ -182,7 +182,6 @@ impl LottieRenderer {

pub fn render(&mut self) -> Result<(), LottieRendererError> {
self.thorvg_canvas.update()?;
self.thorvg_canvas.clear(false, true)?;
self.thorvg_canvas.draw()?;
self.thorvg_canvas.sync()?;

24 changes: 12 additions & 12 deletions dotlottie-rs/src/thorvg.rs
Original file line number Diff line number Diff line change
@@ -116,8 +116,8 @@ impl Canvas {
convert_tvg_result(result, "tvg_swcanvas_set_target")
}

pub fn clear(&self, paints: bool, buffer: bool) -> Result<(), TvgError> {
let result = unsafe { tvg_canvas_clear(self.raw_canvas, paints, buffer) };
pub fn clear(&self, free: bool) -> Result<(), TvgError> {
let result = unsafe { tvg_canvas_clear(self.raw_canvas, free) };

convert_tvg_result(result, "tvg_canvas_clear")
}
@@ -183,16 +183,16 @@ impl Animation {
let mimetype = CString::new(mimetype).expect("Failed to create CString");
let data = CString::new(data).expect("Failed to create CString");

let result = unsafe {
tvg_picture_load_data(
self.raw_paint,
data.as_ptr(),
data.as_bytes().len() as u32,
mimetype.as_ptr(),
std::ptr::null(),
copy,
)
};
let result =
unsafe {
tvg_picture_load_data(
self.raw_paint,
data.as_ptr(),
data.as_bytes().len() as u32,
mimetype.as_ptr(),
copy,
)
};

convert_tvg_result(result, "tvg_picture_load_data")?;