Skip to content

Commit

Permalink
fix #178176: Hang/crash by extending a glissando on a note with anoth…
Browse files Browse the repository at this point in the history
…er one in the second staff
  • Loading branch information
lasconic committed Feb 28, 2017
1 parent 696d420 commit 8ff878f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions libmscore/line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,15 @@ void LineSegment::editDrag(const EditData& ed)
qDebug("LineSegment: move end anchor");
Note* noteOld = static_cast<Note*>(l->endElement());
Note* noteNew = static_cast<Note*>(e);

noteOld->removeSpannerBack(l);
noteNew->addSpannerBack(l);
l->setEndElement(noteNew);

_userOff2 += noteOld->canvasPos() - noteNew->canvasPos();
Note* sNote = static_cast<Note*>(l->startElement());
// do not change anchor if new note is before start note
if (sNote && sNote->chord() && noteNew->chord() && sNote->chord()->tick() < noteNew->chord()->tick()) {
noteOld->removeSpannerBack(l);
noteNew->addSpannerBack(l);
l->setEndElement(noteNew);

_userOff2 += noteOld->canvasPos() - noteNew->canvasPos();
}
}
else if (ed.curGrip == Grip::START && e != l->startElement()) {
qDebug("LineSegment: move start anchor (not impl.)");
Expand Down

0 comments on commit 8ff878f

Please sign in to comment.