diff --git a/src/engraving/dom/slur.cpp b/src/engraving/dom/slur.cpp index dcd15823f527e..027f4eb676e69 100644 --- a/src/engraving/dom/slur.cpp +++ b/src/engraving/dom/slur.cpp @@ -151,6 +151,12 @@ bool SlurSegment::edit(EditData& ed) return false; } if (cr && cr != e1) { + if (cr->staff() != e->staff() && (cr->staffType()->isTabStaff() || e->staffType()->isTabStaff())) { + return false; // Cross-staff slurs don't make sense for TAB staves + } + if (cr->staff()->isLinked(e->staff())) { + return false; // Don't allow slur to cross into staff that's linked to this + } changeAnchor(ed, cr); } return true; @@ -224,8 +230,10 @@ void SlurSegment::changeAnchor(EditData& ed, EngravingItem* element) } } } - score()->undo(new ChangeStartEndSpanner(sp, se, ee)); - renderer()->layoutItem(sp); + if (se && ee) { + score()->undo(new ChangeStartEndSpanner(sp, se, ee)); + renderer()->layoutItem(sp); + } } } diff --git a/src/engraving/rendering/score/slurtielayout.cpp b/src/engraving/rendering/score/slurtielayout.cpp index 8f651858e3b68..fd35df4798540 100644 --- a/src/engraving/rendering/score/slurtielayout.cpp +++ b/src/engraving/rendering/score/slurtielayout.cpp @@ -1582,6 +1582,8 @@ void SlurTieLayout::createSlurSegments(Slur* item, LayoutContext& ctx) { const ChordRest* startCR = item->startCR(); const ChordRest* endCR = item->endCR(); + assert(startCR && endCR); + const System* startSys = startCR->measure()->system(); const System* endSys = endCR->measure()->system();