diff options
author | Carl Hetherington <carl@carlh.net> | 2011-10-22 23:18:54 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-10-22 23:18:54 +0000 |
commit | ab024c7601fd38e9f73eba25b7fc95cfbb31016f (patch) | |
tree | bb6f7aa1fca29fd3c50ea5e873a8259c4e6094a7 /gtk2_ardour | |
parent | b12c890b81d7bace1b6e9a34c0ed6c808484e1c1 (diff) |
Fix snap of note drags when the region position is not itself snapped to the grid (#4322).
git-svn-id: svn://localhost/ardour2/branches/3.0@10288 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index b6b17d27e3..de1b66891f 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -3861,11 +3861,13 @@ NoteDrag::total_dx () const /* new time of the primary note in session frames */ frameoffset_t st = n + dx; + framepos_t const rp = _region->region()->position (); + /* prevent the note being dragged earlier than the region's position */ - st = max (st, _region->region()->position ()); + st = max (st, rp); /* snap and return corresponding delta */ - return _region->snap_frame_to_frame (st) - n; + return _region->snap_frame_to_frame (st - rp) + rp - n; } /** @return Current total drag y change in note number */ |