Skip to content

Commit

Permalink
Fix #314696: Ties end at wrong note
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmcclinch authored and vpereverzev committed Dec 30, 2020
1 parent df2addd commit 60c9ec4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/libmscore/read206.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2333,6 +2333,25 @@ static void convertDoubleArticulations(Chord* chord, XmlReader& e)
}
}

//---------------------------------------------------------
// fixTies
//---------------------------------------------------------

static void fixTies(Chord* chord)
{
std::vector<Note*> notes;
for (Note* note : chord->notes()) {
Tie* tie = note->tieBack();
if (tie && tie->startNote()->pitch() != note->pitch()) {
notes.push_back(tie->startNote());
}
}
for (Note* note : notes) {
Note* endNote = chord->findNote(note->pitch());
note->tieFor()->setEndNote(endNote);
}
}

//---------------------------------------------------------
// readChord
//---------------------------------------------------------
Expand Down Expand Up @@ -2370,6 +2389,7 @@ static void readChord(Chord* chord, XmlReader& e)
}
}
convertDoubleArticulations(chord, e);
fixTies(chord);
}

//---------------------------------------------------------
Expand Down

0 comments on commit 60c9ec4

Please sign in to comment.