summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-10-22 23:17:08 +0000
committerCarl Hetherington <carl@carlh.net>2011-10-22 23:17:08 +0000
commitb12c890b81d7bace1b6e9a34c0ed6c808484e1c1 (patch)
tree2bd0448de37ba8ed70971f6bf7ac79bd748a3ab5 /gtk2_ardour/editor_drag.cc
parent12f443c72109b9a6d3356610a43d01b317f3c788 (diff)
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
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r--gtk2_ardour/editor_drag.cc6
1 files 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;