Skip to content

Commit

Permalink
Merge pull request #256 from cuthbertLab/chord-no-stem
Browse files Browse the repository at this point in the history
allow chords to have no stem
  • Loading branch information
mscuthbert authored Jun 11, 2024
2 parents 67588f3 + 751d285 commit 6ab57ab
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,15 @@ export class NotRest extends GeneralNote {
this.activeVexflowNote = vfn;
return vfn;
}

override vexflowAccidentalsAndDisplay(vfn: VFStaveNote, _options: {} = {}): void {
super.vexflowAccidentalsAndDisplay(vfn, _options);
if (this.stemDirection === 'noStem') {
vfn.glyphProps.stem = false;
vfn.glyphProps.flag = false;
// vfn.render_options.stem_height = 0;
}
}
}

/* ------- Note ----------- */
Expand Down Expand Up @@ -727,10 +736,7 @@ export class Note extends NotRest {
if (debug) {
console.log(this.stemDirection);
}
if (this.stemDirection === 'noStem') {
vfn.glyphProps.stem = false;
// vfn.render_options.stem_height = 0;
} else {
if (this.stemDirection !== 'noStem') {
// correct VexFlow stem length for notes far from the center line;
let staveDNNSpacing = 5;
if (stave !== undefined) {
Expand Down

0 comments on commit 6ab57ab

Please sign in to comment.