From 795c8cb2edec773d04fb0bc1866f6e638f82f937 Mon Sep 17 00:00:00 2001 From: lasconic Date: Sun, 9 Nov 2014 19:37:56 +0000 Subject: [PATCH] fix #38571: Clef displayed incorrectly after change at beginning of system starting with mmrest --- libmscore/undo.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libmscore/undo.cpp b/libmscore/undo.cpp index 9838e9589137..7c0a06e2219a 100644 --- a/libmscore/undo.cpp +++ b/libmscore/undo.cpp @@ -582,6 +582,16 @@ void Score::undoChangeClef(Staff* ostaff, Segment* seg, ClefType st) } clef->setGenerated(false); score->undo(new ChangeClefType(clef, cp, tp)); + // change the clef in the mmRest if any + if (measure->hasMMRest()) { + Measure* mmMeasure = measure->mmRest(); + Segment* mmDestSeg = mmMeasure->findSegment(Segment::Type::Clef, tick); + if (mmDestSeg) { + Clef* mmClef = static_cast(mmDestSeg->element(clef->track())); + if (mmClef) + score->undo(new ChangeClefType(mmClef, cp, tp)); + } + } } else { if (gclef) { @@ -3464,6 +3474,8 @@ void ChangeClefType::flip() concertClef = ocl; transposingClef = otc; + // layout the clef to align the currentClefType with the actual one immediately + clef->layout(); } //---------------------------------------------------------