Skip to content

Commit

Permalink
Merge pull request #5507 from Howard-C/courtesy-accidental
Browse files Browse the repository at this point in the history
fix #292648: make courtesy accidentals stay if notes are changed using Ctrl+Up/Down
  • Loading branch information
dmitrio95 committed Dec 3, 2019
2 parents 2d140a3 + b258c85 commit 431961b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions libmscore/cmd.cpp
Expand Up @@ -1564,12 +1564,17 @@ void Score::upDown(bool up, UpDownMode mode)

if ((oNote->pitch() != newPitch) || (oNote->tpc1() != newTpc1) || oNote->tpc2() != newTpc2) {
// remove accidental if present to make sure
// user added accidentals are removed here.
auto l = oNote->linkList();
for (ScoreElement* e : l) {
Note* ln = toNote(e);
if (ln->accidental())
undo(new RemoveElement(ln->accidental()));
// user added accidentals are removed here
// unless it's an octave change
// in this case courtesy accidentals are preserved
// because they're now harder to be re-entered due to the revised note-input workflow
if (mode != UpDownMode::OCTAVE) {
auto l = oNote->linkList();
for (ScoreElement* e : l) {
Note* ln = toNote(e);
if (ln->accidental())
undo(new RemoveElement(ln->accidental()));
}
}
undoChangePitch(oNote, newPitch, newTpc1, newTpc2);
}
Expand Down

0 comments on commit 431961b

Please sign in to comment.