Skip to content

Commit

Permalink
fix #35036: Grace note after change parent note accidental
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Oct 3, 2014
1 parent 9133473 commit 285452a
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions libmscore/chord.cpp
Expand Up @@ -1583,8 +1583,13 @@ void Chord::layout2()

void Chord::updateNotes(AccidentalState* as)
{
for (Chord* c : _graceNotes)
c->updateNotes(as);

QList<Chord*> graceNotesBefore;
int gnb = getGraceNotesBefore(&graceNotesBefore);
if (gnb) {
for (Chord* c : graceNotesBefore)
c->updateNotes(as);
}

Drumset* drumset = 0;
if (staff()->part()->instr()->useDrumset() != DrumsetKind::NONE)
Expand All @@ -1604,6 +1609,12 @@ void Chord::updateNotes(AccidentalState* as)
for (Note* note : nl)
note->layout10(as);
}
QList<Chord*> graceNotesAfter;
int gna = getGraceNotesAfter(&graceNotesAfter);
if (gna) {
for (Chord* c : graceNotesAfter)
c->updateNotes(as);
}
sortNotes();
}

Expand All @@ -1627,11 +1638,15 @@ void Chord::cmdUpdateNotes(AccidentalState* as)

// PITCHED_ and PERCUSSION_STAFF can go note by note

for (Chord* ch : graceNotes()) {
QList<Note*> notes(ch->notes()); // we need a copy!
for (Note* note : notes)
note->updateAccidental(as);
ch->sortNotes();
QList<Chord*> graceNotesBefore;
int gnb = getGraceNotesBefore(&graceNotesBefore);
if (gnb) {
for (Chord* ch : graceNotesBefore) {
QList<Note*> notes(ch->notes()); // we need a copy!
for (Note* note : notes)
note->updateAccidental(as);
ch->sortNotes();
}
}

QList<Note*> lnotes(notes()); // we need a copy!
Expand Down Expand Up @@ -1662,6 +1677,16 @@ void Chord::cmdUpdateNotes(AccidentalState* as)
}
}
}
QList<Chord*> graceNotesAfter;
int gna = getGraceNotesAfter(&graceNotesAfter);
if (gna) {
for (Chord* ch : graceNotesAfter) {
QList<Note*> notes(ch->notes()); // we need a copy!
for (Note* note : notes)
note->updateAccidental(as);
ch->sortNotes();
}
}
sortNotes();
}

Expand Down

0 comments on commit 285452a

Please sign in to comment.