Fix weird behavior in playhead_x_to_grid: use return value from snap_to_grid.
authorBen Loftis <ben@harrisonconsoles.com>
Wed, 3 Oct 2018 01:12:14 +0000 (20:12 -0500)
committerBen Loftis <ben@harrisonconsoles.com>
Wed, 3 Oct 2018 01:12:21 +0000 (20:12 -0500)
gtk2_ardour/editor_ops.cc

index 7a1abf49c64e72602974031f6579c6e3041dd61c..314e14a05beaa0946eb43e5c65b10260fae79a83 100644 (file)
@@ -7305,7 +7305,7 @@ Editor::playhead_forward_to_grid ()
 
                if (pos.sample < max_samplepos - 1) {
                        pos.sample += 2;
-                       snap_to_internal (pos, RoundUpAlways, SnapToGrid_Scaled, true);
+                       pos = snap_to_grid (pos, RoundUpAlways, SnapToGrid_Scaled);
                        _session->request_locate (pos.sample);
                }
        }
@@ -7338,14 +7338,14 @@ Editor::playhead_backward_to_grid ()
 
                if (pos.sample > 2) {
                        pos.sample -= 2;
-                       snap_to_internal (pos, RoundDownAlways, SnapToGrid_Scaled, true);
+                       pos = snap_to_grid (pos, RoundDownAlways, SnapToGrid_Scaled);
                }
 
                //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_Scaled, true);
+                               pos = snap_to_grid (pos, RoundDownAlways, SnapToGrid_Scaled);
                        }
                }