Skip to content

Commit

Permalink
Merge pull request #1843 from MarcSabatella/49341-barline--single-vis…
Browse files Browse the repository at this point in the history
…ible-staff

partial fix for #49341: initial barline shown for single staff with hide...
  • Loading branch information
lasconic committed Mar 6, 2015
2 parents dacabe8 + 9ce19b9 commit b82eb80
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libmscore/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,15 @@ void System::layout(qreal xo1)
_leftMargin += bracketWidth[i] + bd;
}

int nVisible = 0;
for (int staffIdx = 0; staffIdx < nstaves; ++staffIdx) {
SysStaff* s = _staves[staffIdx];
Staff* staff = score()->staff(staffIdx);
if (!staff->show() || !s->show()) {
s->setbbox(QRectF());
continue;
}
++nVisible;
qreal staffMag = staff->mag();
qreal h;
if (staff->lines() == 1)
Expand All @@ -243,7 +245,7 @@ void System::layout(qreal xo1)
s->bbox().setRect(_leftMargin + xo1, 0.0, 0.0, h);
}

if ((nstaves > 1 && score()->styleB(StyleIdx::startBarlineMultiple)) || (nstaves <= 1 && score()->styleB(StyleIdx::startBarlineSingle))) {
if ((nVisible > 1 && score()->styleB(StyleIdx::startBarlineMultiple)) || (nVisible <= 1 && score()->styleB(StyleIdx::startBarlineSingle))) {
if (_barLine == 0) {
BarLine* bl = new BarLine(score());
bl->setParent(this);
Expand Down

0 comments on commit b82eb80

Please sign in to comment.