Skip to content

Commit

Permalink
fix #27686
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Jul 29, 2014
1 parent ae475eb commit 8d3d3f2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
26 changes: 10 additions & 16 deletions libmscore/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,22 +553,16 @@ Segment* Score::setNoteRest(Segment* segment, int track, NoteVal nval, Fraction
//
// extend slur
//
Chord* e = static_cast<Note*>(nr)->chord();
int stick = 0;
Element* ee = _is.slur()->startElement();
if (!ee)
stick = e->tick();
else if (ee->isChordRest())
stick = static_cast<ChordRest*>(ee)->tick();
else if (ee->type() == Element::Type::NOTE)
stick = static_cast<Note*>(ee)->chord()->tick();
if (stick == e->tick()) {
_is.slur()->setTick(stick);
_is.slur()->setStartElement(e);
}
else {
_is.slur()->setTick2(e->tick());
_is.slur()->setEndElement(e);
Chord* chord = static_cast<Note*>(nr)->chord();
_is.slur()->undoChangeProperty(P_ID::SPANNER_TICK2, chord->tick());
for (Element* e : _is.slur()->linkList()) {
Slur* slur = static_cast<Slur*>(e);
for (Element* e : chord->linkList()) {
if (e->score() == slur->score() && e->track() == slur->track2()) {
slur->score()->undo(new ChangeSpannerElements(slur, slur->startElement(), e));
break;
}
}
}
setLayoutAll(true);
}
Expand Down
4 changes: 2 additions & 2 deletions libmscore/undo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3337,7 +3337,7 @@ void ChangeProperty::flip()
<< property
;
#endif
if (id == P_ID::SPANNER_TICK)
if (id == P_ID::SPANNER_TICK || id == P_ID::SPANNER_TICK2)
element->score()->removeSpanner(static_cast<Spanner*>(element));

QVariant v = element->getProperty(id);
Expand All @@ -3347,7 +3347,7 @@ void ChangeProperty::flip()
else
element->setProperty(id, property);

if (id == P_ID::SPANNER_TICK)
if (id == P_ID::SPANNER_TICK || id == P_ID::SPANNER_TICK2)
element->score()->addSpanner(static_cast<Spanner*>(element));
property = v;
propertyStyle = ps;
Expand Down

0 comments on commit 8d3d3f2

Please sign in to comment.