diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2018-07-26 14:23:59 -0500 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-07-27 00:28:47 +0200 |
commit | 0883f02de92478800ad232f10d388219e2817ed7 (patch) | |
tree | 28e65aba638709df055c1e44ccebf936060313ff /gtk2_ardour/editor_ops.cc | |
parent | 83ce11e4111682c0dfea6b3927a157b9d23556ea (diff) |
new_grid: The Return of the snap_to_X functions.
We no longer assume that Snap always uses the visible ruler lines.
If you want to snap to the grid, and ignore the users zoom scale, use SnapPref::SnapToGrid_Unscaled
This fixes 2 (known) oversights: "snap region(s) to grid" and "regions whose start are left of the canvas edge".
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index f4647553f9..3e757297a9 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -7151,7 +7151,7 @@ Editor::snap_regions_to_grid () (*r)->region()->clear_changes (); MusicSample start ((*r)->region()->first_sample (), 0); - snap_to (start, RoundNearest, SnapToGrid); + snap_to (start, RoundNearest, SnapToGrid_Unscaled, true); (*r)->region()->set_position (start.sample, start.division); _session->add_command(new StatefulDiffCommand ((*r)->region())); } @@ -7369,7 +7369,7 @@ Editor::playhead_forward_to_grid () if (pos.sample < max_samplepos - 1) { pos.sample += 2; - snap_to_internal (pos, RoundUpAlways, SnapToGrid, false, true); + snap_to_internal (pos, RoundUpAlways, SnapToGrid_Scaled, true); _session->request_locate (pos.sample); } } @@ -7402,14 +7402,14 @@ Editor::playhead_backward_to_grid () if (pos.sample > 2) { pos.sample -= 2; - snap_to_internal (pos, RoundDownAlways, SnapToGrid, false, true); + snap_to_internal (pos, RoundDownAlways, SnapToGrid_Scaled, true); } //handle the case where we are rolling, and we're less than one-half second past the mark, we want to go to the prior mark... //also see: jump_backward_to_mark if (_session->transport_rolling()) { if ((playhead_cursor->current_sample() - pos.sample) < _session->sample_rate()/2) { - snap_to_internal (pos, RoundDownAlways, SnapToGrid, false, true); + snap_to_internal (pos, RoundDownAlways, SnapToGrid_Scaled, true); } } |