Skip to content

Commit aca638d

Browse files
authored
Shift grace groups to the end. #528
2 parents a229b74 + afea551 commit aca638d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/rendering/glyphs/VoiceContainerGlyph.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ export class VoiceContainerGlyph extends GlyphGroup {
5757
currentBeatGlyph.x -= graceSprings[currentBeatGlyph.beat.graceIndex].postSpringWidth;
5858
// shift to right position of the particular grace note
5959
currentBeatGlyph.x += graceSprings[currentBeatGlyph.beat.graceIndex].graceBeatWidth;
60+
// move the whole group again forward for cases where another track has e.g. 3 beats and here we have only 2.
61+
// so we shift the whole group of this voice to stick to the end of the group.
62+
const lastGraceSpring = graceSprings[currentBeatGlyph.beat.graceGroup!.beats.length - 1];
63+
currentBeatGlyph.x -= lastGraceSpring.graceBeatWidth;
64+
6065
} else {
6166
// placement for improper grace beats where no beat in the same bar follows
6267
let graceSpring = this.renderer.layoutingInfo.incompleteGraceRods.get(graceGroupId)!;
122 Bytes
Loading

0 commit comments

Comments
 (0)