diff options
author | Carl Hetherington <carl@carlh.net> | 2011-02-07 02:11:31 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-02-07 02:11:31 +0000 |
commit | 5d82f64de0968a78b549e0cac4c7a812e1dee48d (patch) | |
tree | c38913b987ccfe707ace1cf2278a16331bc1671d /gtk2_ardour/editor_ops.cc | |
parent | 7ba6f98f9ceb98404e6d89dcb65ada707cb07be9 (diff) |
Fix fit to window for route groups whose first track is hidden (#3678).
git-svn-id: svn://localhost/ardour2/branches/3.0@8736 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index bc7c625a80..d15180fd42 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -6415,6 +6415,7 @@ Editor::fit_tracks (TrackViewList & tracks) } uint32_t child_heights = 0; + int visible_tracks = 0; for (TrackSelection::iterator t = tracks.begin(); t != tracks.end(); ++t) { @@ -6423,9 +6424,10 @@ Editor::fit_tracks (TrackViewList & tracks) } child_heights += (*t)->effective_height() - (*t)->current_height(); + ++visible_tracks; } - uint32_t h = (uint32_t) floor ((_canvas_height - child_heights - canvas_timebars_vsize) / tracks.size()); + uint32_t h = (uint32_t) floor ((_canvas_height - child_heights - canvas_timebars_vsize) / visible_tracks); double first_y_pos = DBL_MAX; if (h < TimeAxisView::preset_height (HeightSmall)) { @@ -6466,12 +6468,14 @@ Editor::fit_tracks (TrackViewList & tracks) next_is_selected = false; } - if (is_selected) { - (*t)->set_height (h); - first_y_pos = std::min ((*t)->y_position (), first_y_pos); - } else { - if (prev_was_selected && next_is_selected) { - hide_track_in_display (*t); + if ((*t)->marked_for_display ()) { + if (is_selected) { + (*t)->set_height (h); + first_y_pos = std::min ((*t)->y_position (), first_y_pos); + } else { + if (prev_was_selected && next_is_selected) { + hide_track_in_display (*t); + } } } |