Fix the case of jump-to-next{prev}-Mark.
[ardour.git] / gtk2_ardour / editor.cc
index 7526c9677d22fa3d3b5c31f6fb2d52acdda71f4a..78f4e2b405c5230665c9a84d070348548bf12bf4 100644 (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;
+                               }
                        }
                }