Skip to content

Commit

Permalink
alignRest fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
rvilarl committed May 19, 2021
1 parent 5a9e918 commit 159d4bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export class Formatter {
const position = note.getGlyph().position.toUpperCase();
if (position !== 'R/4' && position !== 'B/4') return;

if (alignAllNotes) {
if (alignAllNotes || note.getBeam()) {
// Align rests with previous/next notes.
const props = note.getKeyProps()[0];
if (index === 0) {
Expand Down
5 changes: 5 additions & 0 deletions src/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,11 @@ export abstract class Note extends Tickable {
return this;
}

/** Gets the beam. */
getBeam(): Beam | undefined {
return this.beam;
}

/** Attach this note to a modifier context. */
setModifierContext(mc?: ModifierContext): this {
this.modifierContext = mc;
Expand Down

0 comments on commit 159d4bc

Please sign in to comment.