Skip to content

Commit

Permalink
Merge pull request #1372 from rvilarl/fix/1365
Browse files Browse the repository at this point in the history
fix unnecessary shift
  • Loading branch information
0xfe authored Apr 11, 2022
2 parents 4bc8bf4 + a29af2d commit 561ce82
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/stavenote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export class StaveNote extends StemmableNote {
}
}
} //Very close whole notes
} else {
} else if (lineDiff < 1) {
xShift = voiceXShift + 2;
if (noteU.stemDirection === noteL.stemDirection) {
// upper voice is middle voice, so shift it right
Expand All @@ -259,6 +259,12 @@ export class StaveNote extends StemmableNote {
// shift lower voice right
noteL.note.setXShift(xShift);
}
} else if (noteU.note.hasStem()) {
noteU.stemDirection = -noteU.note.getStemDirection();
noteU.note.setStemDirection(noteU.stemDirection);
} else if (noteL.note.hasStem()) {
noteL.stemDirection = -noteL.note.getStemDirection();
noteL.note.setStemDirection(noteL.stemDirection);
}
}
}
Expand Down

0 comments on commit 561ce82

Please sign in to comment.