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

current_frame() takes in redundant argument length #10

Closed
rishflab opened this issue Mar 28, 2021 · 0 comments · Fixed by #12
Closed

current_frame() takes in redundant argument length #10

rishflab opened this issue Mar 28, 2021 · 0 comments · Fixed by #12
Assignees

Comments

@rishflab
Copy link
Owner

   pub fn current_frame(&self, strip: Range<usize>, length: f32, elapsed: f32) -> u8 {
        let dt = elapsed % length;
        let mut frame = 0;
        for f in self.0[strip].iter().rev() {
            if dt > f.time {
                frame = f.index;
                break;
            }
        }
        frame
    }

length is the last value in strip. does not need to be passed as an arg. extract length from strip.last or something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants