Merge pull request #13618 from mike-spa/invisibleItemBugFix

Invisible cautionary clef bug fix
This commit is contained in:
RomanPudashkin 2022-10-06 11:45:48 +03:00 committed by GitHub
commit f1d80b3961
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View file

@ -4654,15 +4654,21 @@ Fraction Measure::shortestChordRest() const
void Measure::respaceSegments()
{
double x = 0.0;
// Find starting x position (i.e. position of first relevant segment)
for (Segment& s : m_segments) {
if (!s.enabled() || s.allElementsInvisible()) {
continue;
}
x = s.x() + s.width();
if (s.next()) {
s.next()->setPosX(x);
if (s.enabled() && s.visible() && !s.allElementsInvisible()) {
x = s.x();
break;
}
}
// Start respacing segments
for (Segment& s : m_segments) {
s.setPosX(x);
if (s.enabled() && s.visible() && !s.allElementsInvisible()) {
x += s.width();
}
}
// Update measure width
setWidth(x);
}
}

BIN
vtest/scores/invisible.mscz Normal file

Binary file not shown.