From 0883f02de92478800ad232f10d388219e2817ed7 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Thu, 26 Jul 2018 14:23:59 -0500 Subject: 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". --- gtk2_ardour/editor_ops.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gtk2_ardour/editor_ops.cc') 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); } } -- cgit v1.2.3