Skip to content

Commit ff85662

Browse files
committed
Add comment to cloneMMRests
1 parent b80fbdb commit ff85662

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/engraving/dom/excerpt.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,11 @@ static MeasureBase* cloneMeasure(MeasureBase* mb, Score* score, const Score* osc
11371137
void Excerpt::cloneMMRests(Score* sourceScore, Score* dstScore, const std::vector<staff_idx_t>& sourceStavesIndexes,
11381138
const TracksMap& trackList, TieMap& tieMap)
11391139
{
1140+
// When MMRests are enabled in the main score and we are creating a new part or revealing a hidden stave within one, we must copy MMRests
1141+
// Elements are moved from underlying measures to MMRest measures. If we do not copy these MMRests, the elements attached to them will be lost
1142+
// It doesn't matter if the MMRest range is different in the part to the score. As long as the MMRest measure is present in the DOM, MMRestLayout will
1143+
// correct this, setting the appropriate length and moving the elements to the correct locations
1144+
11401145
for (Measure* srcM = sourceScore->firstMeasure(); srcM; srcM = srcM->nextMeasure()) {
11411146
if (!srcM->hasMMRest()) {
11421147
continue;

0 commit comments

Comments
 (0)