diff options
author | nick_m <mainsbridge@gmail.com> | 2017-06-09 11:05:56 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2017-06-09 11:05:56 +1000 |
commit | b4ddbce1ff6701aec8d83a970637f3f2e1693098 (patch) | |
tree | 6ff877ee6b870de89e14ec48c100c6efe6f1e752 /gtk2_ardour/tempo_lines.cc | |
parent | 4ef4f45f3d8812bf6f9b45e06e77e844ce0ce536 (diff) |
Fix incorrect positioning of tempo line subdivisions if first meter is non-zero
Commit cebefe6 assumed that frame 0 was the music origin.
Silly me.
Diffstat (limited to 'gtk2_ardour/tempo_lines.cc')
-rw-r--r-- | gtk2_ardour/tempo_lines.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk2_ardour/tempo_lines.cc b/gtk2_ardour/tempo_lines.cc index cdbde54961..8d1d183d3a 100644 --- a/gtk2_ardour/tempo_lines.cc +++ b/gtk2_ardour/tempo_lines.cc @@ -43,9 +43,10 @@ TempoLines::~TempoLines () } void -TempoLines::tempo_map_changed() +TempoLines::tempo_map_changed (framepos_t new_origin) { lines.clear (); + _bfc->set_origin_b (new_origin); } void @@ -79,7 +80,7 @@ TempoLines::draw_ticks (std::vector<ARDOUR::TempoMap::BBTPoint>& grid, /* draw line with alpha corresponding to coarsest level */ const uint8_t a = max(8, (int)rint(UINT_RGBA_A(base) / (0.8 * log2(level)))); const uint32_t c = UINT_RGBA_CHANGE_A(base, a); - const framepos_t f = _bfc->to (Evoral::Beats (grid.begin()->qn + (l / (double) divisions))); + const framepos_t f = _bfc->to (Evoral::Beats (grid.begin()->qn + (l / (double) divisions))) + _bfc->origin_b(); if (f > leftmost_frame) { lines.add (PublicEditor::instance().sample_to_pixel_unrounded (f), 1.0, c); |