mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
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
This commit is contained in:
parent
7ba6f98f9c
commit
5d82f64de0
1 changed files with 11 additions and 7 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue