1
0
Fork 0

Fix bar start position calculation

This commit is contained in:
Robbert van der Helm 2022-09-12 14:17:06 +02:00
parent 5fa2382c8c
commit 963d1bd14f

View file

@ -338,7 +338,7 @@ impl Transport {
(Some(time_sig_numerator), Some(time_sig_denominator), Some(pos_beats)) => { (Some(time_sig_numerator), Some(time_sig_denominator), Some(pos_beats)) => {
let quarter_note_bar_length = let quarter_note_bar_length =
time_sig_numerator as f64 / time_sig_denominator as f64 * 4.0; time_sig_numerator as f64 / time_sig_denominator as f64 * 4.0;
Some(pos_beats.div_euclid(quarter_note_bar_length)) Some((pos_beats / quarter_note_bar_length).floor() * quarter_note_bar_length)
} }
(_, _, _) => None, (_, _, _) => None,
} }