Skip to content

Commit

Permalink
fix: 🐛 normalize start & end frame when > or < max or zero
Browse files Browse the repository at this point in the history
  • Loading branch information
theashraf committed Jan 17, 2024
1 parent 1163073 commit 8705c10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dotlottie-rs/src/dotlottie_player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ impl DotLottieRuntime {

fn start_frame(&self) -> f32 {
if self.config.segments.len() == 2 {
self.config.segments[0]
self.config.segments[0].max(0.0)
} else {
0.0
}
}

fn end_frame(&self) -> f32 {
if self.config.segments.len() == 2 {
self.config.segments[1]
self.config.segments[1].min(self.total_frames())
} else {
self.total_frames()
}
Expand Down

0 comments on commit 8705c10

Please sign in to comment.