mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
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
This commit is contained in:
parent
b12c890b81
commit
ab024c7601
1 changed files with 4 additions and 2 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue