diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-07-11 06:18:40 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-07-11 06:19:32 -0400 |
commit | 8bc0ac7529dbecb1efc5a6daa4ec055431234d73 (patch) | |
tree | 1b5768819aaa61a6d84d04a7e6d2b4399802147d /gtk2_ardour/editor_ops.cc | |
parent | 6157c685d98350f855cff97bfcac55769cc58db3 (diff) |
restore correct functioning of fit-tracks, which was mistakenly removed because of a failure to understand its complexities
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index eb5b22ee62..f4582704d8 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -6817,9 +6817,9 @@ Editor::fit_tracks (TrackViewList & tracks) } } - /* operate on all tracks, hide unselected ones that are in the middle of selected ones */ - - bool within_selected = false; + bool prev_was_selected = false; + bool is_selected = tracks.contains (all.front()); + bool next_is_selected; for (TrackViewList::iterator t = all.begin(); t != all.end(); ++t) { @@ -6827,16 +6827,26 @@ Editor::fit_tracks (TrackViewList & tracks) next = t; ++next; - + + if (next != all.end()) { + next_is_selected = tracks.contains (*next); + } else { + next_is_selected = false; + } + if ((*t)->marked_for_display ()) { - if (tracks.contains (*t)) { + if (is_selected) { (*t)->set_height (h); first_y_pos = std::min ((*t)->y_position (), first_y_pos); - within_selected = true; - } else if (within_selected) { - hide_track_in_display (*t); + } else { + if (prev_was_selected && next_is_selected) { + hide_track_in_display (*t); + } } } + + prev_was_selected = is_selected; + is_selected = next_is_selected; } /* |