From: Robin Gareus Date: Sun, 29 Jan 2017 08:34:09 +0000 (+0100) Subject: Keep tracks visible when re-ordering them in the editor X-Git-Tag: 5.6~133 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=34da2896c636a18376f0da2da8c2732f52c99461;p=ardour.git Keep tracks visible when re-ordering them in the editor --- 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