Prechádzať zdrojové kódy

feat: 修改stavenote

TIANYONG 1 rok pred
rodič
commit
15c6baf1e1

+ 1 - 1
osmd-extended/src/MusicalScore/Graphical/VexFlow/VexFlowConverter.ts

@@ -604,7 +604,7 @@ export class VexFlowConverter {
             // 自定义符杆朝向
             const DYMusicalOrientation = (window as any).DYMusicalOrientation
             wantedStemDirection = DYMusicalOrientation !== undefined ? DYMusicalOrientation : wantedStemDirection
-            console.log(11111,vfnote)
+            // console.log(11111,vfnote)
             switch (wantedStemDirection) {
                 case(StemDirectionType.Up):
                     vfnote.setStemDirection(VF.Stem.UP);

+ 5 - 2
osmd-extended/src/VexFlowPatch/src/stavenote.js

@@ -416,7 +416,7 @@ export class StaveNote extends StemmableNote {
   constructor(noteStruct) {
     super(noteStruct);
     this.setAttribute('type', 'StaveNote');
-
+    console.log('stavenote.js~')
     this.keys = noteStruct.keys;
     this.clef = noteStruct.clef;
     this.octave_shift = noteStruct.octave_shift;
@@ -463,7 +463,10 @@ export class StaveNote extends StemmableNote {
     if (noteStruct.auto_stem) {
       this.autoStem();
     } else {
-      this.setStemDirection(noteStruct.stem_direction);
+      // 自定义符杆朝向
+      const DYMusicalOrientation = window.DYMusicalOrientation
+      const direction = DYMusicalOrientation !== undefined ? DYMusicalOrientation : noteStruct.stem_direction
+      this.setStemDirection(direction);
     }
     this.reset();
     this.buildFlag();