From e3a8f2786d364f9496dbaa8a27e9058fedeff411 Mon Sep 17 00:00:00 2001 From: nick_m Date: Sat, 13 Aug 2016 05:23:59 +1000 Subject: [PATCH] Ensure positive length whan drag-adding new midi region. --- gtk2_ardour/editor_drag.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 6fa3cb099d..5852f10b43 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -518,7 +518,7 @@ Drag::add_midi_region (MidiTimeAxisView* view, bool commit, const int32_t sub_nu /* not that the frame rate used here can be affected by pull up/down which might be wrong. */ - framecnt_t len = map.frame_at_beat (map.beat_at_frame (pos) + 1.0) - pos; + framecnt_t len = map.frame_at_beat (max (0.0, map.beat_at_frame (pos)) + 1.0) - pos; return view->add_region (grab_frame(), len, commit, sub_num); }