From b757756e92309946bfa7101579e561c4179d866c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 18 Dec 2020 13:10:46 -0700 Subject: [PATCH] BBT ruler: fix error in setting beat count --- gtk2_ardour/editor_rulers.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index e83b0a8177..dcff173699 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -1081,8 +1081,8 @@ Editor::compute_bbt_ruler_scale (samplepos_t lower, samplepos_t upper) double ruler_line_granularity = UIConfiguration::instance().get_ruler_granularity (); //in pixels ruler_line_granularity = _visible_canvas_width / (ruler_line_granularity*5); //fudge factor '5' probably related to (4+1 beats)/measure, I think - beats = (ceil_upper_beat - floor_lower_beat); - double beat_density = ((beats + 1) * ((double) (upper - lower) / (double) (1 + beat_after_upper_pos - beat_before_lower_pos))) / (float)ruler_line_granularity; + beats = (ceil_upper_beat - floor_lower_beat).get_beats(); // - bbt_bars; possible thinko; this fixes the problem (for me) where measure lines alternately appear&disappear while playing at certain zoom scales + double beat_density = ((beats + 1) * ((double) (upper - lower) / (double) (1 + beat_after_upper_pos - beat_before_lower_pos))) / 5.0; /* Only show the bar helper if there aren't many bars on the screen */ if ((bbt_bars < 2) || (beats < 5)) {