diff options
author | David Robillard <d@drobilla.net> | 2014-12-16 23:02:28 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-12-18 20:23:34 -0500 |
commit | 66870ddf09001000025e60011ec1874241b0fef5 (patch) | |
tree | 28715e649f1ecd210d79a89da8a9c649ec4d110e /gtk2_ardour/editor_mouse.cc | |
parent | 60313085209a6213a7388e0b1070c10e83fe2a10 (diff) |
Restore snap when switching to/from internal.
Diffstat (limited to 'gtk2_ardour/editor_mouse.cc')
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 99f0775106..7a264e35de 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -293,16 +293,28 @@ Editor::mouse_mode_toggled (MouseMode m) } if (mouse_mode == m) { - /* switch "in to" the same mode, act like a toggle and switch back to previous mode */ + /* switch to the same mode, act like a toggle and switch back to previous mode */ Glib::RefPtr<Action> pact = get_mouse_mode_action(previous_mouse_mode); Glib::RefPtr<ToggleAction> ptact = Glib::RefPtr<ToggleAction>::cast_dynamic(pact); ptact->set_active(true); return; } + const bool was_internal = internal_editing(); + previous_mouse_mode = mouse_mode; mouse_mode = m; + if (!was_internal && internal_editing()) { + /* switched to internal, switch to internal snap settings */ + set_snap_to(internal_snap_type); + set_snap_mode(internal_snap_mode); + } else if (was_internal && !internal_editing()) { + /* switched out of internal, switch to non-internal snap settings */ + set_snap_to(pre_internal_snap_type); + set_snap_mode(pre_internal_snap_mode); + } + instant_save (); /* this should generate a new enter event which will |