summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-05-03 00:45:54 +0000
committerCarl Hetherington <carl@carlh.net>2011-05-03 00:45:54 +0000
commit55586be83a596381e06a8c5270e6f22ef8bf5bd6 (patch)
tree2f651574ceacd2117a7de97203524e2817997dc5
parentd1f58cf5a46eca318d25d762968955edd4fad5a7 (diff)
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
-rw-r--r--gtk2_ardour/editor_drag.cc7
1 files changed, 6 insertions, 1 deletions
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;