Skip to content

Commit

Permalink
Merge pull request #76 from mgavioli/TAB_fretConlfict
Browse files Browse the repository at this point in the history
Fix #18117
  • Loading branch information
mgavioli committed Sep 12, 2012
2 parents 6bf8e61 + ed2f9d0 commit b2cf717
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions libmscore/tablature.cpp
Expand Up @@ -156,8 +156,8 @@ int Tablature::fret(int pitch, int string) const

void Tablature::fretChord(Chord * chord) const
{
int nFret, nNewFret, nTempFret;
int nString, nNewString, nTempString;
int nFret, nNewFret, nTempFret;
int nString, nNewString, nTempString;

if(bFretting)
return;
Expand All @@ -174,8 +174,8 @@ void Tablature::fretChord(Chord * chord) const

// scan chord notes from highest, matching with strings from the highest
foreach(Note * note, sortedNotes) {
nString = nNewString = note->string();
nFret = nNewFret = note->fret();
nString = nNewString = note->string();
nFret = nNewFret = note->fret();
note->setFretConflict(false); // assume no conflicts on this note
// if no fretting yet or current fretting is no longer valid
if (nString == -1 || nFret == -1 || getPitch(nString, nFret) != note->pitch()) {
Expand All @@ -184,9 +184,11 @@ void Tablature::fretChord(Chord * chord) const
// no way to fit this note in this tab:
// mark as fretting conflict
note->setFretConflict(true);
// // store pitch change without affecting chord context
// chord->score()->undo(new ChangePitch(note, note->pitch(), note->tpc(),
// note->line(), nNewFret, nNewString));
// store fretting change without affecting chord context
if (nFret != nNewFret)
note->score()->undoChangeProperty(note, P_FRET, nNewFret);
if (nString != nNewString)
note->score()->undoChangeProperty(note, P_STRING, nNewString);
continue;
}

Expand Down

0 comments on commit b2cf717

Please sign in to comment.