Skip to content

Commit

Permalink
fix #277367 invisible notes and rests remain part of the skyline
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Nov 30, 2018
1 parent 070f767 commit e118390
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions libmscore/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3240,21 +3240,39 @@ System* Score::collectSystem(LayoutContext& lc)

for (int staffIdx = 0; staffIdx < nstaves(); ++staffIdx) {
SysStaff* ss = system->staff(staffIdx);
ss->skyline().clear();
Skyline& skyline = ss->skyline();
skyline.clear();
for (MeasureBase* mb : system->measures()) {
if (!mb->isMeasure())
continue;
Measure* m = toMeasure(mb);
for (Segment& s : m->segments()) {
if (!s.enabled() || s.isTimeSigType()) // hack: ignore time signatures
continue;
ss->skyline().add(s.staffShape(staffIdx).translated(s.pos() + m->pos()));
QPointF pos(s.pos() + m->pos());
if (s.segmentType() & (SegmentType::BarLine | SegmentType::EndBarLine | SegmentType::StartRepeatBarLine | SegmentType::BeginBarLine)) {
BarLine* bl = toBarLine(s.element(0));
if (bl) {
qreal w = BarLine::layoutWidth(score(), bl->barLineType());
skyline.add(QRectF(0.0, 0.0, w, spatium() * 4.0).translated(bl->pos() + pos));
}
}
else {
int strack = staffIdx * VOICES;
int etrack = strack + VOICES;
for (Element* e : s.elist()) {
if (!e || !e->visible())
continue;
int effectiveTrack = e->vStaffIdx() * VOICES + e->voice();
if (effectiveTrack >= strack && effectiveTrack < etrack)
skyline.add(e->shape().translated(e->pos() + pos));
}
}
}
ss->skyline().add(m->staffLines(staffIdx)->bbox().translated(m->pos()));
}
}


//-------------------------------------------------------------
// layout beams + fingering
//-------------------------------------------------------------
Expand Down

0 comments on commit e118390

Please sign in to comment.