Fix editor sizing issue introduced in 4dc65e66
[ardour.git] / gtk2_ardour / editor_mouse.cc
index 4b15b5d0e0daa85b61897d96bb9e0dd84315099a..5fc952481046e382743c3c20cc3dc8d8ea3d1cdd 100644 (file)
@@ -317,10 +317,10 @@ Editor::mouse_mode_toggled (MouseMode m)
        /* Switch snap type/mode if we're moving to/from an internal tool.  Note
           this must toggle the actions and not call set_snap_*() directly,
           otherwise things get out of sync and the combo box stops working. */
-       if (!UIConfiguration::instance().get_grid_follows_internal()) {
+       if (!UIConfiguration::instance().get_grid_follows_internal()) {
                grid_type_action(pre_internal_grid_type)->set_active(true);
                snap_mode_action(pre_internal_snap_mode)->set_active(true);
-       } else if (!was_internal && internal_editing()) {
+       } else if (!was_internal && internal_editing()) {
                grid_type_action(internal_grid_type)->set_active(true);
                snap_mode_action(internal_snap_mode)->set_active(true);
        } else if (was_internal && !internal_editing()) {
@@ -1599,7 +1599,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
 
                case MarkerBarItem:
                        if (!_dragging_playhead) {
-                               snap_to_with_modifier (where, event, RoundNearest, SnapToAny, true);
+                               snap_to_with_modifier (where, event, RoundNearest, SnapToGrid_Scaled);
                                mouse_add_new_marker (where.sample);
                        }
                        return true;
@@ -1607,7 +1607,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
                case CdMarkerBarItem:
                        if (!_dragging_playhead) {
                                /* if we get here then a dragged range wasn't done */
-                               snap_to_with_modifier (where, event, RoundNearest, SnapToAny, true);
+                               snap_to_with_modifier (where, event, RoundNearest, SnapToGrid_Scaled);
                                mouse_add_new_marker (where.sample, true);
                        }
                        return true;
@@ -2106,17 +2106,17 @@ Editor::motion_handler (ArdourCanvas::Item* /*item*/, GdkEvent* event, bool from
 
        update_join_object_range_location (event->motion.y);
 
-       /* snapped_cursor stuff (the snapped_cursor shows where an operation is going to occur) */
-       bool ignored;
-       MusicSample where (0, 0);
-       if (mouse_sample (where.sample, ignored)) {
-               snap_to_with_modifier (where, event);
-               set_snapped_cursor_position (where.sample);
-       }
-
-       /* drags might also change the snapped_cursor location, because we are snapping the thing being dragged, not the actual mouse cursor */
        if (_drags->active ()) {
+               //drags change the snapped_cursor location, because we are snapping the thing being dragged, not the actual mouse cursor
                return _drags->motion_handler (event, from_autoscroll);
+       } else {
+               //the snapped_cursor shows where an operation (like Split) is going to occur
+               bool ignored;
+               MusicSample where (0, 0);
+               if (mouse_sample (where.sample, ignored)) {
+                       snap_to_with_modifier (where, event);
+                       set_snapped_cursor_position (where.sample);
+               }
        }
 
        return false;