summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-08-13 05:23:59 +1000
committernick_m <mainsbridge@gmail.com>2016-08-14 03:04:54 +1000
commite3a8f2786d364f9496dbaa8a27e9058fedeff411 (patch)
treeaa93e1ac108cf1c5430a448fc9a92b613233e901 /gtk2_ardour/editor_drag.cc
parent3f24d5d96ea6c930a071d955b33804bc901e9b0e (diff)
Ensure positive length whan drag-adding new midi region.
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r--gtk2_ardour/editor_drag.cc2
1 files changed, 1 insertions, 1 deletions
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);
}