Ver código fonte

clefs: fix forward/backup node detection (#954) for mid-measure clefs

sschmid 4 anos atrás
pai
commit
3d5003dbd1
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      src/MusicalScore/ScoreIO/InstrumentReader.ts

+ 2 - 2
src/MusicalScore/ScoreIO/InstrumentReader.ts

@@ -901,8 +901,8 @@ export class InstrumentReader {
         //   so when there's a <forward> or <backup> instruction in <attributes> (which is unfortunate encoding), this gets misplaced.
         //   so for now we skip it.
         const skipClefInstruction: boolean =
-          previousNode?.elements("forward").length > 0 ||
-          previousNode?.elements("backup").length > 0;
+          previousNode?.name === "forward" ||
+          previousNode?.name === "backup";
         if (!skipClefInstruction) {
           const clefInstruction: ClefInstruction = new ClefInstruction(clefEnum, clefOctaveOffset, line);
           this.abstractInstructions.push([staffNumber, clefInstruction]);