Skip to content

Commit

Permalink
Clear old system before laying out current system
Browse files Browse the repository at this point in the history
Systems are cleared when they are fetched.  If a measure used to be on a later system and has moved to be on the current system, the later system must also be cleared before the current system's elements are laid out.  This frees spanner segments which will be reused.
  • Loading branch information
miiizen committed Aug 12, 2024
1 parent 9784899 commit c3a8c2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/engraving/rendering/dev/systemlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ System* SystemLayout::collectSystem(LayoutContext& ctx)
break;
}

if (oldSystem && system != oldSystem && muse::contains(ctx.state().systemList(), oldSystem)) {
oldSystem->clear();
}

if (ctx.state().prevMeasure() && ctx.state().prevMeasure()->isMeasure() && ctx.state().prevMeasure()->system() == system) {
//
// now we know that the previous measure is not the last
Expand Down

0 comments on commit c3a8c2b

Please sign in to comment.