Skip to content

Commit

Permalink
Fix accidental palette interactions
Browse files Browse the repository at this point in the history
  • Loading branch information
iwoithe committed Oct 16, 2022
1 parent 7a80182 commit d9f5fc8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/engraving/libmscore/accidental.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

#include "accidental.h"

#include "editdata.h"
#include "engravingitem.h"
#include "engravingobject.h"
#include "infrastructure/symbolfont.h"
#include "rw/xml.h"
#include "types/symnames.h"
Expand Down Expand Up @@ -542,6 +545,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
Expand All @@ -559,6 +566,9 @@ EngravingItem* Accidental::drop(EditData& data)
{
EngravingItem* e = data.dropElement;
switch (e->type()) {
case ElementType::ACCIDENTAL:
score()->changeAccidental(toAccidental(e)->accidentalType());
break;
case ElementType::ACTION_ICON:
switch (toActionIcon(e)->actionType()) {
case ActionIconType::PARENTHESES:
Expand All @@ -575,7 +585,7 @@ EngravingItem* Accidental::drop(EditData& data)
default:
break;
}
delete e;
// delete e;
return nullptr;
}

Expand Down

0 comments on commit d9f5fc8

Please sign in to comment.