Skip to content

Commit

Permalink
Don't compute stuff on staves that aren't shown
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-spa committed Jun 28, 2023
1 parent 4b6168a commit c1931db
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/engraving/layout/v0/measurelayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,10 @@ void MeasureLayout::getNextMeasure(LayoutContext& ctx)
//
for (size_t staffIdx = 0; staffIdx < ctx.dom().nstaves(); ++staffIdx) {
const Staff* staff = ctx.dom().staff(staffIdx);
if (!staff->show()) {
continue;
}

const Drumset* drumset
= staff->part()->instrument(measure->tick())->useDrumset() ? staff->part()->instrument(measure->tick())->drumset() : 0;
AccidentalState as; // list of already set accidentals for this measure
Expand Down Expand Up @@ -912,6 +916,11 @@ void MeasureLayout::getNextMeasure(LayoutContext& ctx)
}

for (staff_idx_t staffIdx = 0; staffIdx < ctx.dom().nstaves(); ++staffIdx) {
const Staff* staff = ctx.dom().staff(staffIdx);
if (!staff->show()) {
continue;
}

for (Segment& segment : measure->segments()) {
if (segment.isChordRestType()) {
ChordLayout::layoutChords1(ctx, &segment, staffIdx);
Expand Down

0 comments on commit c1931db

Please sign in to comment.