13
0

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:
Carl Hetherington 2011-04-20 23:50:31 +00:00
parent 8fc896a24d
commit 884de065bd

View File

@ -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);
}
}