diff --git a/dotlottie-ffi/src/dotlottie_player.udl b/dotlottie-ffi/src/dotlottie_player.udl index a7aa1ed6..330d2048 100644 --- a/dotlottie-ffi/src/dotlottie_player.udl +++ b/dotlottie-ffi/src/dotlottie_player.udl @@ -4,15 +4,10 @@ namespace dotlottie_player { enum Mode { "Forward", "Reverse", - "ForwardBounce", + "Bounce", "ReverseBounce" }; -enum Direction { - "Forward", - "Reverse" -}; - dictionary Config { boolean autoplay; boolean loop_animation; @@ -45,5 +40,4 @@ interface DotLottiePlayer { boolean render(); boolean resize(u32 width, u32 height); void clear(); - Direction direction(); }; \ No newline at end of file diff --git a/dotlottie-rs/src/dotlottie_player.rs b/dotlottie-rs/src/dotlottie_player.rs index c91f96ed..d8b4c621 100644 --- a/dotlottie-rs/src/dotlottie_player.rs +++ b/dotlottie-rs/src/dotlottie_player.rs @@ -12,12 +12,11 @@ pub enum PlaybackState { pub enum Mode { Forward, Reverse, - ForwardBounce, + Bounce, ReverseBounce, } -#[derive(PartialEq, Clone, Copy)] -pub enum Direction { +enum Direction { Forward, Reverse, } @@ -46,7 +45,7 @@ impl DotLottieRuntime { let direction = match config.mode { Mode::Forward => Direction::Forward, Mode::Reverse => Direction::Reverse, - Mode::ForwardBounce => Direction::Forward, + Mode::Bounce => Direction::Forward, Mode::ReverseBounce => Direction::Reverse, }; @@ -61,10 +60,6 @@ impl DotLottieRuntime { } } - pub fn direction(&self) -> Direction { - self.direction - } - pub fn is_loaded(&self) -> bool { self.is_loaded } @@ -117,7 +112,7 @@ impl DotLottieRuntime { let end_frame = self.total_frames() - 1.0; match self.config.mode { - Mode::Forward | Mode::ForwardBounce => { + Mode::Forward | Mode::Bounce => { self.set_frame(start_frame); } Mode::Reverse | Mode::ReverseBounce => { @@ -187,7 +182,7 @@ impl DotLottieRuntime { next_frame } } - Mode::ForwardBounce => match self.direction { + Mode::Bounce => match self.direction { Direction::Forward => { if next_frame >= total_frames { self.direction = Direction::Reverse; @@ -295,7 +290,7 @@ impl DotLottieRuntime { let end_frame = self.total_frames() - 1.0; match self.config.mode { - Mode::Forward | Mode::ForwardBounce => { + Mode::Forward | Mode::Bounce => { self.set_frame(first_frame); self.direction = Direction::Forward; } @@ -449,10 +444,6 @@ impl DotLottiePlayer { pub fn config(&self) -> Config { self.runtime.read().unwrap().config() } - - pub fn direction(&self) -> Direction { - self.runtime.read().unwrap().direction() - } } unsafe impl Send for DotLottiePlayer {}