Skip to content

Commit

Permalink
fix ignoring frame while previous frame is fading
Browse files Browse the repository at this point in the history
  • Loading branch information
tom1484 committed Mar 22, 2024
1 parent 429e898 commit a32cdf4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions editor-server/src/routes/api/get_dancer_led_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,17 @@ fn filter_identical_frames(statuses: Vec<Status>) -> Vec<Status> {
// Remove executive identical frames
let mut keep_frame = vec![true; statuses.len()];
for (i, (identical, fade)) in identical_and_fade.iter().enumerate() {
// Must keep if previous frame is not the same
let identical_prev = i != 0 && identical_and_fade[i - 1].0;
if !identical_prev {
if !identical && *fade {
continue;
}

if !identical && *fade {
// Must keep if previous frame is not the same
if i > 0 {
let prev = identical_and_fade[i - 1];
if !prev.0 || (!identical && prev.1) {
continue;
}
} else {
continue;
}

Expand Down

0 comments on commit a32cdf4

Please sign in to comment.