Skip to content

Commit

Permalink
Shift grace groups to the end. CoderLine#528
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielku15 authored Jan 17, 2021
2 parents a229b74 + afea551 commit aca638d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rendering/glyphs/VoiceContainerGlyph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ export class VoiceContainerGlyph extends GlyphGroup {
currentBeatGlyph.x -= graceSprings[currentBeatGlyph.beat.graceIndex].postSpringWidth;
// shift to right position of the particular grace note
currentBeatGlyph.x += graceSprings[currentBeatGlyph.beat.graceIndex].graceBeatWidth;
// move the whole group again forward for cases where another track has e.g. 3 beats and here we have only 2.
// so we shift the whole group of this voice to stick to the end of the group.
const lastGraceSpring = graceSprings[currentBeatGlyph.beat.graceGroup!.beats.length - 1];
currentBeatGlyph.x -= lastGraceSpring.graceBeatWidth;

} else {
// placement for improper grace beats where no beat in the same bar follows
let graceSpring = this.renderer.layoutingInfo.incompleteGraceRods.get(graceGroupId)!;
Expand Down
Binary file modified test-data/visual-tests/special-notes/grace-notes-advanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aca638d

Please sign in to comment.