Merge pull request #11624 from mike-spa/hiddenStavesAdditionalSpaceFix

Fix #9345: KeySig in hidden staves cause additional space
This commit is contained in:
Elnur Ismailzada 2022-05-17 10:58:58 +03:00 committed by GitHub
commit 64e0b656ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -605,6 +605,14 @@ void LayoutSystem::hideEmptyStaves(Score* score, System* system, bool isFirstSys
SysStaff* ss = system->staff(staff->idx());
ss->setShow(true);
}
// Re-create the shapes to account for newly hidden or un-hidden staves
for (auto mb : system->measures()) {
if (mb->isMeasure()) {
for (auto& seg : toMeasure(mb)->segments()) {
seg.createShapes();
}
}
}
}
void LayoutSystem::layoutSystemElements(const LayoutOptions& options, LayoutContext& lc, Score* score, System* system)

View file

@ -2221,6 +2221,9 @@ void Segment::createShape(staff_idx_t staffIdx)
{
Shape& s = _shapes[staffIdx];
s.clear();
if (system() && !system()->staves().at(staffIdx)->show()) {
return;
}
if (segmentType() & (SegmentType::BarLine | SegmentType::EndBarLine | SegmentType::StartRepeatBarLine | SegmentType::BeginBarLine)) {
setVisible(true);