From 34da2896c636a18376f0da2da8c2732f52c99461 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 29 Jan 2017 09:34:09 +0100 Subject: [PATCH] Keep tracks visible when re-ordering them in the editor --- gtk2_ardour/editor_routes.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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::iterator trailing; list::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::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 -- 2.30.2