diff options
author | Robin Gareus <robin@gareus.org> | 2017-01-29 09:34:09 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-01-29 09:34:09 +0100 |
commit | 34da2896c636a18376f0da2da8c2732f52c99461 (patch) | |
tree | 559d5ef5d6ec79b9562f4cb56cfb37dfc3c10e77 /gtk2_ardour/editor_routes.cc | |
parent | 007ad4e3341fef1c3ccd4c69f358f0787addf0d7 (diff) |
Keep tracks visible when re-ordering them in the editor
Diffstat (limited to 'gtk2_ardour/editor_routes.cc')
-rw-r--r-- | gtk2_ardour/editor_routes.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index 016d5432f3..1406ed43a7 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -1641,6 +1641,8 @@ EditorRoutes::move_selected_tracks (bool up) list<ViewStripable>::iterator trailing; list<ViewStripable>::iterator leading; + TimeAxisView* scroll_to = NULL; + if (up) { trailing = view_stripables.begin(); @@ -1651,6 +1653,9 @@ EditorRoutes::move_selected_tracks (bool up) while (leading != view_stripables.end()) { if (_editor->selection->selected (leading->tav)) { view_stripables.insert (trailing, ViewStripable (*leading)); + if (!scroll_to) { + scroll_to = leading->tav; + } leading = view_stripables.erase (leading); } else { ++leading; @@ -1675,6 +1680,9 @@ EditorRoutes::move_selected_tracks (bool up) while (1) { if (_editor->selection->selected (leading->tav)) { + if (!scroll_to) { + scroll_to = leading->tav; + } list<ViewStripable>::iterator tmp; /* need to insert *after* trailing, not *before* it, @@ -1740,6 +1748,11 @@ EditorRoutes::move_selected_tracks (bool up) _model->reorder (neworder); + + if (scroll_to) { + _editor->ensure_time_axis_view_is_visible (*scroll_to, false); + } + } void |