Fix the case of jump-to-next{prev}-Mark.

This commit is contained in:
Ben Loftis 2016-12-19 16:42:58 -06:00
parent 05119ae3ee
commit 6ebf14c2c2

View file

@ -2920,11 +2920,16 @@ Editor::snap_to_internal (framepos_t& start, RoundMode direction, bool for_mark,
} else if (after == max_framepos) {
start = before;
} else if (before != max_framepos && after != max_framepos) {
/* have before and after */
if ((start - before) < (after - start)) {
start = before;
} else {
if ((direction == RoundUpMaybe || direction == RoundUpAlways))
start = after;
else if ((direction == RoundDownMaybe || direction == RoundDownAlways))
start = before;
else if (direction == 0 ) {
if ((start - before) < (after - start)) {
start = before;
} else {
start = after;
}
}
}