Skip to content

Commit

Permalink
Merge pull request #4668 from mattmcclinch/280685-paste-repeat-measure
Browse files Browse the repository at this point in the history
fix #280685: Copying measure repeats doesn't work
  • Loading branch information
anatoly-os committed Feb 26, 2019
2 parents b2f32e0 + fe5a71b commit 3feb678
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libmscore/paste.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,12 +517,19 @@ void Score::pasteChordRest(ChordRest* cr, const Fraction& t, const Interval& src
Fraction measureEnd = measure->endTick();
bool isGrace = cr->isChord() && toChord(cr)->noteType() != NoteType::NORMAL;

// find out if the chordrest was only partially contained in the copied range
bool partialCopy = false;
if (cr->isRepeatMeasure())
partialCopy = toRepeatMeasure(cr)->actualDuration() != measure->len();
else if (!isGrace && !cr->tuplet())
partialCopy = cr->durationTypeTicks() != cr->actualTicks();

// if note is too long to fit in measure, split it up with a tie across the barline
// exclude tuplets from consideration
// we have already disallowed a tuplet from crossing the barline, so there is no problem here
// but due to rounding, it might appear from actualTicks() that the last note is too long by a couple of ticks

if (!isGrace && !cr->tuplet() && (tick + cr->actualTicks() > measureEnd || (cr->durationTypeTicks() != cr->actualTicks()) || convertMeasureRest)) {
if (!isGrace && !cr->tuplet() && (tick + cr->actualTicks() > measureEnd || partialCopy || convertMeasureRest)) {
if (cr->isChord()) {
// split Chord
Chord* c = toChord(cr);
Expand Down

0 comments on commit 3feb678

Please sign in to comment.