Преглед изворни кода

Fixed a bug where vexflow does not support having 8va and the 'bass' type

Benjamin Giesinger пре 7 година
родитељ
комит
ad0630dd63
1 измењених фајлова са 5 додато и 8 уклоњено
  1. 5 8
      src/MusicalScore/Graphical/VexFlow/VexFlowConverter.ts

+ 5 - 8
src/MusicalScore/Graphical/VexFlow/VexFlowConverter.ts

@@ -362,14 +362,11 @@ export class VexFlowConverter {
             default:
         }
 
-        switch (clef.OctaveOffset) {
-            case 1:
-                annotation = "8va";
-                break;
-            case -1:
-                annotation = "8vb";
-                break;
-            default:
+        // annotations in vexflow don't allow bass and 8va. No matter the offset :(
+        if (clef.OctaveOffset === 1 && type !== "bass" ) {
+            annotation = "8va";
+        } else if (clef.OctaveOffset === -1) {
+            annotation = "8vb";
         }
         return { type, size, annotation };
     }