Fix accidentals on transposition

This commit is contained in:
Matthias Neeracher 2011-09-26 04:50:24 +02:00
parent c942def59c
commit 6fcf53935e

View File

@ -972,6 +972,8 @@ void VLSong::ChangeKey(int section, int newKey, int newMode, bool transpose)
FlipAccidentals(i->fVisual); FlipAccidentals(i->fVisual);
FlipAccidentals(i->fRootAccidental); FlipAccidentals(i->fRootAccidental);
} }
i->fVisual = VLPitchAccidental(i->fPitch, i->fVisual, newKey);
i->fRootAccidental = VLPitchAccidental(i->fRootPitch, i->fRootAccidental, newKey);
} }
} }
for (int pass=0; pass<2 && semi;) { for (int pass=0; pass<2 && semi;) {
@ -990,6 +992,7 @@ void VLSong::ChangeKey(int section, int newKey, int newMode, bool transpose)
i->fPitch += semi; i->fPitch += semi;
if (flipAcc) if (flipAcc)
FlipAccidentals(i->fVisual); FlipAccidentals(i->fVisual);
i->fVisual = VLPitchAccidental(i->fPitch, i->fVisual, newKey);
low = std::min(low, i->fPitch); low = std::min(low, i->fPitch);
high = std::max(high, i->fPitch); high = std::max(high, i->fPitch);
} }