Skip to content

Commit

Permalink
Merge pull request #1124 from MarcSabatella/14353-system-lyrics
Browse files Browse the repository at this point in the history
fix #14353: lyrics and staff spacers don't work with hide empty staves
  • Loading branch information
lasconic committed Aug 12, 2014
2 parents e446da4 + 2b02b0a commit c4b25c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libmscore/system.cpp
Expand Up @@ -304,6 +304,7 @@ void System::layout2()
qreal y = 0.0;
int lastStaffIdx = 0; // last visible staff
int firstStaffIdx = -1;
qreal lastStaffDistanceDown = 0.0;
for (int staffIdx = 0; staffIdx < nstaves; ++staffIdx) {
Staff* staff = score()->staff(staffIdx);
StyleIdx downDistance;
Expand Down Expand Up @@ -335,6 +336,7 @@ void System::layout2()

SysStaff* s = _staves[staffIdx];
qreal distDown = score()->styleS(downDistance).val() * _spatium + userDist;
qreal nominalDistDown = distDown;
qreal distUp = 0.0;
int n = ml.size();
for (int i = 0; i < n; ++i) {
Expand All @@ -356,13 +358,16 @@ void System::layout2()
s->bbox().setRect(_leftMargin, y + dup, width() - _leftMargin, sHeight);
y += dup + sHeight + s->distanceDown();
lastStaffIdx = staffIdx;
lastStaffDistanceDown = distDown - nominalDistDown;
if (firstStaffIdx == -1)
firstStaffIdx = staffIdx;
}
if (firstStaffIdx == -1)
firstStaffIdx = 0;

qreal systemHeight = staff(lastStaffIdx)->bbox().bottom();
if (lastStaffIdx < nstaves - 1)
systemHeight += lastStaffDistanceDown;
setHeight(systemHeight);

int n = ml.size();
Expand Down

0 comments on commit c4b25c0

Please sign in to comment.