Skip to content

Commit

Permalink
fix #1345: Lines (Slurs, hairpins and dynamics) not hidden for a hidd…
Browse files Browse the repository at this point in the history
…en measure
  • Loading branch information
lasconic committed Jun 21, 2013
1 parent 43f1feb commit 9e7b66b
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion libmscore/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,28 @@ void System::scanElements(void* data, void (*func)(void*, Element*), bool all)
qDebug("System::scanElements: staffIDx == -1: %s %p", ss->spanner()->name(), ss->spanner());
staffIdx = 0;
}
if (all || score()->staff(staffIdx)->show())
bool v = true;
Spanner* spanner = ss->spanner();
if(spanner->anchor() == Spanner::ANCHOR_SEGMENT || spanner->anchor() == Spanner::ANCHOR_CHORD) {
Element* se = spanner->startElement();
Element* ee = spanner->endElement();
bool v1 = true;
if(se && (se->type() == Element::CHORD || se->type() == Element::REST)) {
ChordRest* cr = static_cast<ChordRest*>(se);
Measure* m = cr->measure();
MStaff* mstaff = m->mstaff(cr->staffIdx());
v1 = mstaff->visible();
}
bool v2 = true;
if(!v1 && ee && (ee->type() == Element::CHORD || ee->type() == Element::REST)) {
ChordRest* cr = static_cast<ChordRest*>(ee);
Measure* m = cr->measure();
MStaff* mstaff = m->mstaff(cr->staffIdx());
v2 = mstaff->visible();
}
v = v1 || v2; // hide spanner if both chords are hidden
}
if (all || (score()->staff(staffIdx)->show() && v))
func(data, ss);
}
}
Expand Down

0 comments on commit 9e7b66b

Please sign in to comment.