diff --git a/src/engraving/libmscore/accidental.cpp b/src/engraving/libmscore/accidental.cpp index 9b3224e115f89..95df781fdb801 100644 --- a/src/engraving/libmscore/accidental.cpp +++ b/src/engraving/libmscore/accidental.cpp @@ -394,6 +394,10 @@ bool Accidental::acceptDrop(EditData& data) const { EngravingItem* e = data.dropElement; + if (e->type() == ElementType::ACCIDENTAL) { + return true; + } + if (e->isActionIcon()) { ActionIconType type = toActionIcon(e)->actionType(); return type == ActionIconType::PARENTHESES @@ -411,6 +415,9 @@ EngravingItem* Accidental::drop(EditData& data) { EngravingItem* e = data.dropElement; switch (e->type()) { + case ElementType::ACCIDENTAL: + score()->changeAccidental(note(), toAccidental(e)->accidentalType()); + break; case ElementType::ACTION_ICON: switch (toActionIcon(e)->actionType()) { case ActionIconType::PARENTHESES: diff --git a/src/engraving/libmscore/cmd.cpp b/src/engraving/libmscore/cmd.cpp index 4c7c8f4c161f1..4d4414a5c8d74 100644 --- a/src/engraving/libmscore/cmd.cpp +++ b/src/engraving/libmscore/cmd.cpp @@ -1959,8 +1959,27 @@ void Score::toggleAccidental(AccidentalType at, const EditData& ed) void Score::changeAccidental(AccidentalType idx) { - for (Note* note : selection().noteList()) { - changeAccidental(note, idx); + for (EngravingItem* item : selection().elements()) { + Accidental* accidental = 0; + Note* note = 0; + switch (item->type()) { + case ElementType::ACCIDENTAL: + accidental = toAccidental(item); + + if (accidental->accidentalType() == idx) { + changeAccidental(accidental->note(), AccidentalType::NONE); + } else { + changeAccidental(accidental->note(), idx); + } + + break; + case ElementType::NOTE: + note = toNote(item); + changeAccidental(note, idx); + break; + default: + break; + } } }