Skip to content

Commit

Permalink
fix #64506: temporary corruption on add of measure repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Jun 9, 2015
1 parent 0cdde77 commit 9f9eb54
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libmscore/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ void Score::deleteItem(Element* el)
removeChordRest(rm, false);
Rest* rest = new Rest(this);
rest->setDurationType(TDuration::DurationType::V_MEASURE);
rest->setDuration(rm->measure()->len());
rest->setDuration(rm->measure()->stretchedLen(rm->staff()));
rest->setTrack(rm->track());
rest->setParent(rm->parent());
Segment* segment = rm->segment();
Expand Down
2 changes: 2 additions & 0 deletions libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,8 @@ RepeatMeasure* Measure::cmdInsertRepeatMeasure(int staffIdx)
RepeatMeasure* rm = new RepeatMeasure(_score);
rm->setTrack(staffIdx * VOICES);
rm->setParent(seg);
rm->setDurationType(TDuration::DurationType::V_MEASURE);
rm->setDuration(stretchedLen(_score->staff(staffIdx)));
_score->undoAddCR(rm, this, tick());
foreach (Element* el, _el) {
if (el->type() == Element::Type::SLUR && el->staffIdx() == staffIdx)
Expand Down
2 changes: 1 addition & 1 deletion libmscore/repeat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void RepeatMeasure::layout()
Fraction RepeatMeasure::duration() const
{
if (measure())
return measure()->len();
return measure()->stretchedLen(staff());
return Fraction(0, 1);
}

Expand Down
3 changes: 2 additions & 1 deletion mscore/debugger/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ void Debugger::updateElement(Element* el)
case Element::Type::MEASURE: ew = new MeasureView; break;
case Element::Type::CHORD: ew = new ChordDebug; break;
case Element::Type::NOTE: ew = new ShowNoteWidget; break;
case Element::Type::REPEAT_MEASURE:
case Element::Type::REST: ew = new RestView; break;
case Element::Type::CLEF: ew = new ClefView; break;
case Element::Type::TIMESIG: ew = new TimeSigView; break;
Expand Down Expand Up @@ -1205,7 +1206,7 @@ void ShowNoteWidget::accidentalClicked()
RestView::RestView()
: ShowElementBase()
{
// chort rest
// chord rest
crb.setupUi(addWidget());
crb.beamMode->addItem("auto");
crb.beamMode->addItem("beam begin");
Expand Down

0 comments on commit 9f9eb54

Please sign in to comment.