From b12c890b81d7bace1b6e9a34c0ed6c808484e1c1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 22 Oct 2011 23:17:08 +0000 Subject: [PATCH] Fix check on dragging MIDI notes to a point before the region position. git-svn-id: svn://localhost/ardour2/branches/3.0@10287 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_drag.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 3b82fa332e..b6b17d27e3 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -3858,13 +3858,11 @@ NoteDrag::total_dx () const /* primary note time */ frameoffset_t const n = _region->source_beats_to_absolute_frames (_primary->note()->time ()); - /* new time of the primary note relative to the region position */ + /* new time of the primary note in session frames */ frameoffset_t st = n + dx; /* prevent the note being dragged earlier than the region's position */ - if (st < 0) { - st = 0; - } + st = max (st, _region->region()->position ()); /* snap and return corresponding delta */ return _region->snap_frame_to_frame (st) - n;