Skip to content

Commit

Permalink
fix #45356: manual position of a line (8va, cresc., etc.) not preserv…
Browse files Browse the repository at this point in the history
…ed on copy/paste
  • Loading branch information
lasconic committed Jun 27, 2015
1 parent 79411f0 commit 656451f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions libmscore/element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,8 @@ void Element::writeProperties(Xml& xml) const
xml.tag("lid", _links->lid());
if (!userOff().isNull()) {
if (type() == Element::Type::VOLTA_SEGMENT
|| type() == Element::Type::GLISSANDO_SEGMENT || isChordRest())
|| type() == Element::Type::GLISSANDO_SEGMENT || isChordRest()
|| (xml.clipboardmode && isSLineSegment()))
xml.tag("offset", userOff() / spatium());
else
xml.tag("pos", pos() / score()->spatium());
Expand Down Expand Up @@ -1544,7 +1545,16 @@ QVariant Element::propertyDefault(P_ID id) const
bool Element::isSLine() const
{
return type() == Element::Type::HAIRPIN || type() == Element::Type::OTTAVA || type() == Element::Type::PEDAL
|| type() == Element::Type::TRILL || type() == Element::Type::VOLTA || type() == Element::Type::TEXTLINE || type() == Element::Type::NOTELINE;
|| type() == Element::Type::TRILL || type() == Element::Type::VOLTA || type() == Element::Type::TEXTLINE || type() == Element::Type::NOTELINE || type() == Element::Type::GLISSANDO;
}

//---------------------------------------------------------
// isSLine
//---------------------------------------------------------

bool Element::isSLineSegment() const
{
return type() == Element::Type::HAIRPIN_SEGMENT || type() == Element::Type::OTTAVA_SEGMENT || type() == Element::Type::PEDAL_SEGMENT || type() == Element::Type::TRILL_SEGMENT || type() == Element::Type::VOLTA_SEGMENT || type() == Element::Type::TEXTLINE_SEGMENT || type() == Element::Type::GLISSANDO_SEGMENT;
}

//---------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions libmscore/element.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ class Element : public QObject, public ScoreElement {

bool isDurationElement() const { return isChordRest() || (type() == Element::Type::TUPLET); }
bool isSLine() const;
bool isSLineSegment() const;

virtual void draw(QPainter*) const {}

Expand Down

0 comments on commit 656451f

Please sign in to comment.