From 55586be83a596381e06a8c5270e6f22ef8bf5bd6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 3 May 2011 00:45:54 +0000 Subject: [PATCH] Prevent note drags from moving a note before the start of its region. git-svn-id: svn://localhost/ardour2/branches/3.0@9463 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_drag.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index b1c26ffb9d..ed821c8f15 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -3850,7 +3850,12 @@ NoteDrag::total_dx () const frameoffset_t const n = _region->beats_to_frames (_primary->note()->time ()); /* new time of the primary note relative to the region position */ - frameoffset_t const st = n + dx; + frameoffset_t st = n + dx; + + /* prevent the note being dragged earlier than the region's position */ + if (st < 0) { + st = 0; + } /* snap and return corresponding delta */ return _region->snap_frame_to_frame (st) - n;