mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-22 14:46:34 +01:00
restore correct functioning of fit-tracks, which was mistakenly removed because of a failure to understand its complexities
This commit is contained in:
parent
a46ff2bc31
commit
f6fd3d18b9
1 changed files with 18 additions and 8 deletions
|
|
@ -6855,9 +6855,9 @@ Editor::fit_tracks (TrackViewList & tracks)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* operate on all tracks, hide unselected ones that are in the middle of selected ones */
|
bool prev_was_selected = false;
|
||||||
|
bool is_selected = tracks.contains (all.front());
|
||||||
bool within_selected = false;
|
bool next_is_selected;
|
||||||
|
|
||||||
for (TrackViewList::iterator t = all.begin(); t != all.end(); ++t) {
|
for (TrackViewList::iterator t = all.begin(); t != all.end(); ++t) {
|
||||||
|
|
||||||
|
|
@ -6866,17 +6866,27 @@ Editor::fit_tracks (TrackViewList & tracks)
|
||||||
next = t;
|
next = t;
|
||||||
++next;
|
++next;
|
||||||
|
|
||||||
|
if (next != all.end()) {
|
||||||
|
next_is_selected = tracks.contains (*next);
|
||||||
|
} else {
|
||||||
|
next_is_selected = false;
|
||||||
|
}
|
||||||
|
|
||||||
if ((*t)->marked_for_display ()) {
|
if ((*t)->marked_for_display ()) {
|
||||||
if (tracks.contains (*t)) {
|
if (is_selected) {
|
||||||
(*t)->set_height (h);
|
(*t)->set_height (h);
|
||||||
first_y_pos = std::min ((*t)->y_position (), first_y_pos);
|
first_y_pos = std::min ((*t)->y_position (), first_y_pos);
|
||||||
within_selected = true;
|
} else {
|
||||||
} else if (within_selected) {
|
if (prev_was_selected && next_is_selected) {
|
||||||
hide_track_in_display (*t);
|
hide_track_in_display (*t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prev_was_selected = is_selected;
|
||||||
|
is_selected = next_is_selected;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
set the controls_layout height now, because waiting for its size
|
set the controls_layout height now, because waiting for its size
|
||||||
request signal handler will cause the vertical adjustment setting to fail
|
request signal handler will cause the vertical adjustment setting to fail
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue