From 751d2858a4db55d141697b2e04d124c372b357cb Mon Sep 17 00:00:00 2001 From: Michael Scott Asato Cuthbert Date: Mon, 10 Jun 2024 15:31:04 -1000 Subject: [PATCH] allow chords to have no stem also remove flags on noStem notes. --- src/note.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/note.ts b/src/note.ts index 76157703..fb434503 100644 --- a/src/note.ts +++ b/src/note.ts @@ -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 ----------- */ @@ -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) {