소스 검색

feat: 修改stavenote

TIANYONG 1 년 전
부모
커밋
15c6baf1e1
2개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      osmd-extended/src/MusicalScore/Graphical/VexFlow/VexFlowConverter.ts
  2. 5 2
      osmd-extended/src/VexFlowPatch/src/stavenote.js

+ 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();