Fix weird behavior in playhead_x_to_grid: use return value from snap_to_grid.

This commit is contained in:
Ben Loftis 2018-10-02 20:12:14 -05:00
parent e36aa9fab7
commit 35243c9b3e

View file

@ -7305,7 +7305,7 @@ Editor::playhead_forward_to_grid ()
if (pos.sample < max_samplepos - 1) { if (pos.sample < max_samplepos - 1) {
pos.sample += 2; pos.sample += 2;
snap_to_internal (pos, RoundUpAlways, SnapToGrid_Scaled, true); pos = snap_to_grid (pos, RoundUpAlways, SnapToGrid_Scaled);
_session->request_locate (pos.sample); _session->request_locate (pos.sample);
} }
} }
@ -7338,14 +7338,14 @@ Editor::playhead_backward_to_grid ()
if (pos.sample > 2) { if (pos.sample > 2) {
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... //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 //also see: jump_backward_to_mark
if (_session->transport_rolling()) { if (_session->transport_rolling()) {
if ((playhead_cursor->current_sample() - pos.sample) < _session->sample_rate()/2) { 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);
} }
} }