Skip to content

Commit

Permalink
Merge pull request #2055 from MarcSabatella/64506-repeat-measure-dura…
Browse files Browse the repository at this point in the history
…tion

fix #64506: temporary corruption on add of measure repeat
  • Loading branch information
wschweer committed Jun 10, 2015
2 parents 8156e08 + 6ee93fb commit 3507567
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 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
6 changes: 3 additions & 3 deletions mtest/guitarpro/repeated-bars.gpx-ref.mscx
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@
<Measure number="2">
<RepeatMeasure>
<lid>15</lid>
<durationType>measure</durationType>
<duration z="4" n="4"/>
</RepeatMeasure>
<tick>3840</tick>
<BarLine>
<subtype>end</subtype>
<span>1</span>
Expand Down Expand Up @@ -396,9 +396,9 @@
<Measure number="2">
<RepeatMeasure>
<lid>15</lid>
<durationType>measure</durationType>
<duration z="4" n="4"/>
</RepeatMeasure>
<tick>3840</tick>
<BarLine>
<subtype>end</subtype>
<span>1</span>
Expand Down Expand Up @@ -459,9 +459,9 @@
<Measure number="2">
<RepeatMeasure>
<lid>15</lid>
<durationType>measure</durationType>
<duration z="4" n="4"/>
</RepeatMeasure>
<tick>3840</tick>
<BarLine>
<subtype>end</subtype>
<span>1</span>
Expand Down

0 comments on commit 3507567

Please sign in to comment.