summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_tempodisplay.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-08-13 02:23:07 +1000
committernick_m <mainsbridge@gmail.com>2016-08-14 03:04:53 +1000
commit5c2ccc4f3eeccaedf8399e0c80d0394cf2b4f132 (patch)
tree3725e8f5b4abf8c0a2dc1f277ba8e5e9999b5561 /gtk2_ardour/editor_tempodisplay.cc
parent23d1d1f55bdb6c1e4418284afdf50c74dc1e25ed (diff)
Allow negative return in TempoMap::beat_at_frame() and its exact_ variant.
- audio-locked midi regions can be start-trimmed properly when close to 1|1|0 - a midi region placed before the first meter will continue the tempo curve and first meter. Only a couple of callers require change, as bbt_at_beat() already deals with this.
Diffstat (limited to 'gtk2_ardour/editor_tempodisplay.cc')
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc
index 722490c26e..9c562a4d86 100644
--- a/gtk2_ardour/editor_tempodisplay.cc
+++ b/gtk2_ardour/editor_tempodisplay.cc
@@ -279,7 +279,7 @@ Editor::compute_current_bbt_points (std::vector<TempoMap::BBTPoint>& grid, frame
/* prevent negative values of leftmost from creeping into tempomap
*/
- const double lower_beat = floor (_session->tempo_map().beat_at_frame (leftmost)) - 1.0;
+ const double lower_beat = floor (max (0.0, _session->tempo_map().beat_at_frame (leftmost))) - 1.0;
_session->tempo_map().get_grid (grid, max (_session->tempo_map().frame_at_beat (lower_beat), (framepos_t) 0), rightmost);
}