mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-30 08:53:08 +01:00
When drawing MIDI regions with grid snap enabled, make the region extent 1 frame shy of the next grid boundary. In this way, a duplicate of the new region will land on a grid snap point.
git-svn-id: svn://localhost/ardour2/branches/3.0@9398 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8fc896a24d
commit
884de065bd
1 changed files with 8 additions and 2 deletions
|
|
@ -1370,8 +1370,14 @@ RegionCreateDrag::motion (GdkEvent* event, bool first_move)
|
|||
_region->set_position (f, this);
|
||||
}
|
||||
|
||||
/* again, don't use a zero-length region (see above) */
|
||||
framecnt_t const len = abs (f - grab_frame ());
|
||||
/* Don't use a zero-length region, and subtract 1 frame from the snapped length
|
||||
so that if this region is duplicated, its duplicate starts on
|
||||
a snap point rather than 1 frame after a snap point. Otherwise things get
|
||||
a bit confusing as if a region starts 1 frame after a snap point, one cannot
|
||||
place snapped notes at the start of the region.
|
||||
*/
|
||||
|
||||
framecnt_t const len = abs (f - grab_frame () - 1);
|
||||
_region->set_length (len < 1 ? 1 : len, this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue