Explorar o código

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

part of #588
Simon Schmid %!s(int64=5) %!d(string=hai) anos
pai
achega
6608f17641
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  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);