瀏覽代碼

fix(Slurs): read slur orientation from xml (#962) (sibelius alternative to placement)

fixes #962
sschmid 4 年之前
父節點
當前提交
4ab1c44030
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/MusicalScore/ScoreIO/MusicSymbolModules/SlurReader.ts

+ 8 - 0
src/MusicalScore/ScoreIO/MusicSymbolModules/SlurReader.ts

@@ -37,6 +37,14 @@ export class SlurReader {
                                 slurPlacementXml = PlacementEnum.Below;
                             }
                         }
+                        const orientationAttr: Attr = slurNode.attribute("orientation"); // alternative for placement, used by Sibelius
+                        if (orientationAttr && orientationAttr.value) {
+                            if (orientationAttr.value === "over") {
+                                slurPlacementXml = PlacementEnum.Above;
+                            } else if (orientationAttr.value === "under") {
+                                slurPlacementXml = PlacementEnum.Below;
+                            }
+                        }
                         if (type === "start") {
                             let slur: Slur = this.openSlurDict[slurNumber];
                             if (!slur) {