Skip to content
Permalink
Browse files

Merge pull request #4743 from songchaow/fix_cross_measure

fix #285100: Crash when moving beam if first note of beam is in the first measure and other notes of beam are in the second measure
  • Loading branch information
anatoly-os committed Mar 4, 2019
2 parents 5cc4d6b + 08c583f commit 00ed31b255c925811d89dbab150d45cf9684f74c
Showing with 12 additions and 2 deletions.
  1. +12 −2 libmscore/layout.cpp
@@ -2235,7 +2235,8 @@ void Score::createBeams(Measure* measure)
if (!beamNoContinue(prevCR->beamMode())
&& !pm->lineBreak() && !pm->pageBreak() && !pm->sectionBreak()) {
beam = prevCR->beam();
a1 = beam ? beam->elements().front() : prevCR;
//a1 = beam ? beam->elements().front() : prevCR;
a1 = beam ? nullptr : prevCR; // when beam is found, a1 is no longer required.
}
}
}
@@ -2355,8 +2356,17 @@ void Score::createBeams(Measure* measure)
}
if (beam)
beam->layout1();
else if (a1)
else if (a1) {
// if a1 is the last chord/rest in current measure
if (a1->segment()->next(SegmentType::ChordRest) == nullptr) {
const auto b = a1->beam();
// if the second chord/rest in a1's beam (it must be in next measure) has forced MID beam mode
if (b && b->elements().startsWith(a1) && b->elements().size()>=2 && b->elements()[1]->beamMode() == Beam::Mode::MID)
// do not delete the origin beam
continue;
}
a1->removeDeleteBeam(false);
}
}
}

0 comments on commit 00ed31b

Please sign in to comment.
You can’t perform that action at this time.