Skip to content

Commit

Permalink
fix #277038: concert pitch doesn't reset key sig to C at start of sys…
Browse files Browse the repository at this point in the history
…tem when toggled
  • Loading branch information
jthistle committed Nov 20, 2018
1 parent 6ba431b commit 7425757
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libmscore/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void CmdState::setUpdateMode(UpdateMode m)
//---------------------------------------------------------
// startCmd
/// Start a GUI command by clearing the redraw area
/// and starting a user-visble undo.
/// and starting a user-visible undo.
//---------------------------------------------------------

void Score::startCmd()
Expand Down
9 changes: 8 additions & 1 deletion libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3551,9 +3551,16 @@ void Measure::addSystemHeader(bool isFirstSystem)
Key key = score()->staff(i)->key(tick());
if ((e && !e->generated()) || (key != keyIdx.key())) {
disable = false;
break;
}
else if (e && e->generated() && key == keyIdx.key() && keyIdx.key() == Key::C){
// If a key sig segment is disabled, it may be re-enabled if there is
// a transposing instrument using a different key sig.
// To prevent this from making the wrong key sig display, remove any key
// sigs on staves where the key in this measure is C.
score()->undo(new RemoveElement(e));
}
}

if (disable)
kSegment->setEnabled(false);
else {
Expand Down
4 changes: 1 addition & 3 deletions libmscore/transpose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,7 @@ void Score::transposeKeys(int staffStart, int staffEnd, int tickStart, int tickE
segmentInterval.flip();
}
KeySig* ks = toKeySig(s->element(staffIdx * VOICES));
if (!ks)
continue;
if (ks->generated())
if (!ks || (ks->generated() && ks->segment()->rtick() > 0))
continue;
if (s->tick() == 0)
createKey = false;
Expand Down

0 comments on commit 7425757

Please sign in to comment.