Skip to content

Commit

Permalink
Merge pull request musescore#18248 from mike-spa/optimizationTest
Browse files Browse the repository at this point in the history
Don't compute stuff on staves that aren't shown
  • Loading branch information
RomanPudashkin committed Jul 12, 2023
2 parents e588e44 + c1931db commit 06bfbe5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/engraving/layout/v0/measurelayout.cpp
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 06bfbe5

Please sign in to comment.