fix #178176: Hang/crash by extending a glissando on a note with another one in the second staff

This commit is contained in:
lasconic 2017-02-28 16:48:15 +01:00
parent c0f92cc9f9
commit 24d192df37

View file

@ -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);
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);
noteOld->removeSpannerBack(l);
noteNew->addSpannerBack(l);
l->setEndElement(noteNew);
_userOff2 += noteOld->canvasPos() - noteNew->canvasPos();
_userOff2 += noteOld->canvasPos() - noteNew->canvasPos();
}
}
else if (ed.curGrip == Grip::START && e != l->startElement()) {
qDebug("LineSegment: move start anchor (not impl.)");