Skip to content

Commit

Permalink
Merge pull request #4403 from MarcSabatella/279988-show-something
Browse files Browse the repository at this point in the history
fix #279988: in preventing empty system, pick a visible staff to show
  • Loading branch information
anatoly-os committed Dec 18, 2018
2 parents 486c90c + f3c6425 commit 17f7a3f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libmscore/layout.cpp
Expand Up @@ -1293,18 +1293,22 @@ void Score::hideEmptyStaves(System* system, bool isFirstSystem)

++staffIdx;
}
Staff* firstVisible = nullptr;
if (systemIsEmpty) {
for (Staff* staff : _staves) {
SysStaff* ss = system->staff(staff->idx());
if (staff->showIfEmpty() && !ss->show()) {
ss->setShow(true);
systemIsEmpty = false;
}
else if (!firstVisible && staff->show()) {
firstVisible = staff;
}
}
}
// don’t allow a complete empty system
if (systemIsEmpty) {
Staff* staff = _staves.front();
Staff* staff = firstVisible ? firstVisible : _staves.front();
SysStaff* ss = system->staff(staff->idx());
ss->setShow(true);
}
Expand Down

0 comments on commit 17f7a3f

Please sign in to comment.