mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
Fix weird behavior in playhead_x_to_grid: use return value from snap_to_grid.
This commit is contained in:
parent
e36aa9fab7
commit
35243c9b3e
1 changed files with 3 additions and 3 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue