mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-27 15:38:19 +01:00
Grid: explicitly check for empty marker list (fixes: grid fails if no start+end markers yet)
This commit is contained in:
parent
b279c42158
commit
4a036a2daa
1 changed files with 6 additions and 4 deletions
|
|
@ -2941,12 +2941,14 @@ Editor::snap_to_marker (samplepos_t presnap, RoundMode direction)
|
|||
samplepos_t after;
|
||||
samplepos_t test;
|
||||
|
||||
if (_session->locations()->list().empty()) {
|
||||
/* No marks to snap to, so just don't snap */
|
||||
return test;
|
||||
}
|
||||
|
||||
_session->locations()->marks_either_side (presnap, before, after);
|
||||
|
||||
if (before == max_samplepos && after == max_samplepos) {
|
||||
/* No marks to snap to, so just don't snap */
|
||||
return presnap;
|
||||
} else if (before == max_samplepos) {
|
||||
if (before == max_samplepos) {
|
||||
test = after;
|
||||
} else if (after == max_samplepos) {
|
||||
test = before;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue