Skip to content

Commit

Permalink
fix drawing bug at pan sign change
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetophon committed Nov 16, 2024
1 parent bdeb797 commit d10be06
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,27 @@ impl DelayGraph {
line_length
};

for i in 0..NUM_TAPS {
let previous_pan_foreground_length =
params.previous_pan_foreground_lengths[i].load(Ordering::SeqCst);
let previous_pan_background_length =
params.previous_pan_background_lengths[i].load(Ordering::SeqCst);

// Check for sign change
if target_pan_foreground_length.signum()
!= previous_pan_foreground_length.signum()
{
params.previous_pan_foreground_lengths[i]
.store(target_pan_foreground_length, Ordering::SeqCst);
}
if target_pan_background_length.signum()
!= previous_pan_background_length.signum()
{
params.previous_pan_background_lengths[i]
.store(target_pan_background_length, Ordering::SeqCst);
}
}

let pan_foreground_length = Self::gui_smooth(
target_pan_foreground_length,
&params.previous_pan_foreground_lengths[i],
Expand Down

0 comments on commit d10be06

Please sign in to comment.