Selaa lähdekoodia

fix(barlines): fix left barline added to end barline (#588)

part of #588
Simon Schmid 5 vuotta sitten
vanhempi
commit
6608f17641
1 muutettua tiedostoa jossa 7 lisäystä ja 2 poistoa
  1. 7 2
      src/MusicalScore/ScoreIO/InstrumentReader.ts

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

@@ -476,8 +476,13 @@ export class InstrumentReader {
              this.currentMeasure.endsPiece = true;
            }
           }
-          if (xmlNode.element("bar-style") !== undefined) {
-            this.currentMeasure.endingBarStyle = xmlNode.element("bar-style").value;
+          const barStyleElement: IXmlElement = xmlNode.element("bar-style");
+          if (barStyleElement !== undefined) {
+            const location: Attr = barStyleElement.attribute("location");
+            if (location !== undefined && location.value === "right") {
+              this.currentMeasure.endingBarStyle = xmlNode.element("bar-style").value;
+            }
+            // TODO do we need to process bars with left location too?
           }
         } else if (xmlNode.name === "sound") {
           // (*) MetronomeReader.readTempoInstruction(xmlNode, this.musicSheet, this.currentXmlMeasureIndex);