Skip to content

Commit

Permalink
Use gap rests when copy/pasting in secondary voices
Browse files Browse the repository at this point in the history
  • Loading branch information
mathesoncalum committed Aug 12, 2024
1 parent 828165c commit 4a30746
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/engraving/rw/read400/read400.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,13 +711,12 @@ bool Read400::pasteStaff(XmlReader& e, Segment* dst, staff_idx_t dstStaff, Fract
score->setLayout(dstTick, dstTick + tickLen, dstStaff, endStaff, dst);
}

//check and add truly invisible rests instead of gaps
//TODO: look if this could be done different
Measure* dstM = score->tick2measure(dstTick);
Measure* endM = score->tick2measure(dstTick + tickLen);
for (staff_idx_t i = dstStaff; i < endStaff; i++) {
for (Measure* m = dstM; m && m != endM->nextMeasure(); m = m->nextMeasure()) {
m->checkMeasure(i, false);
m->checkMeasure(i);
}
}
score->m_selection.setRangeTicks(dstTick, dstTick + tickLen, dstStaff, endStaff);
Expand Down
3 changes: 1 addition & 2 deletions src/engraving/rw/read410/read410.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,13 +723,12 @@ bool Read410::pasteStaff(XmlReader& e, Segment* dst, staff_idx_t dstStaff, Fract
score->setLayout(dstTick, dstTick + tickLen, dstStaff, endStaff, dst);
}

//check and add truly invisible rests instead of gaps
//TODO: look if this could be done different
Measure* dstM = score->tick2measure(dstTick);
Measure* endM = score->tick2measure(dstTick + tickLen);
for (staff_idx_t i = dstStaff; i < endStaff; i++) {
for (Measure* m = dstM; m && m != endM->nextMeasure(); m = m->nextMeasure()) {
m->checkMeasure(i, false);
m->checkMeasure(i);
}
}
score->m_selection.setRangeTicks(dstTick, dstTick + tickLen, dstStaff, endStaff);
Expand Down

0 comments on commit 4a30746

Please sign in to comment.