Skip to content

Commit

Permalink
fix #65861: paste of single chord symbol does not transpose
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella authored and lasconic committed Jun 22, 2015
1 parent 48eb831 commit 9279bcb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion libmscore/chordrest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "harmony.h"
#include "figuredbass.h"
#include "icon.h"
#include "utils.h"

namespace Ms {

Expand Down Expand Up @@ -882,7 +883,19 @@ Element* ChordRest::drop(const DropData& data)
break;

case Element::Type::HARMONY:
static_cast<Harmony*>(e)->render();
{
// transpose
Harmony* harmony = static_cast<Harmony*>(e);
Interval interval = staff()->part()->instrument()->transpose();
if (!score()->styleB(StyleIdx::concertPitch) && !interval.isZero()) {
interval.flip();
int rootTpc = transposeTpc(harmony->rootTpc(), interval, true);
int baseTpc = transposeTpc(harmony->baseTpc(), interval, true);
score()->undoTransposeHarmony(harmony, rootTpc, baseTpc);
}
// render
harmony->render();
}
// fall through
case Element::Type::TEXT:
case Element::Type::STAFF_TEXT:
Expand Down
2 changes: 1 addition & 1 deletion libmscore/paste.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ PasteStatus Score::cmdPaste(const QMimeData* ms, MuseScoreView* view)
qDebug("no application mime data");
return PasteStatus::NO_MIME;
}
if ((_selection.isSingle()|| _selection.isList()) && ms->hasFormat(mimeSymbolFormat)) {
if ((_selection.isSingle() || _selection.isList()) && ms->hasFormat(mimeSymbolFormat)) {
QByteArray data(ms->data(mimeSymbolFormat));
XmlReader e(data);
QPointF dragOffset;
Expand Down

0 comments on commit 9279bcb

Please sign in to comment.