Просмотр исходного кода

fix(skyline) Fix for diminuendo wedges
diminuendo lines direction needed reversed for skyline/bottom line calculation

Justin Litten 5 лет назад
Родитель
Сommit
154fc8f956
1 измененных файлов с 10 добавлено и 2 удалено
  1. 10 2
      src/MusicalScore/Graphical/GraphicalContinuousDynamicExpression.ts

+ 10 - 2
src/MusicalScore/Graphical/GraphicalContinuousDynamicExpression.ts

@@ -72,7 +72,11 @@ export class GraphicalContinuousDynamicExpression extends AbstractGraphicalExpre
         switch (this.Placement) {
         switch (this.Placement) {
             case PlacementEnum.Above:
             case PlacementEnum.Above:
                 if (!this.IsVerbal) {
                 if (!this.IsVerbal) {
-                    skyBottomLineCalculator.updateSkyLineWithWedge(this.lines[0].Start, this.lines[0].End);
+                    if (this.ContinuousDynamic.DynamicType === ContDynamicEnum.diminuendo) {
+                        skyBottomLineCalculator.updateSkyLineWithWedge(this.lines[0].End, this.lines[0].Start);
+                    } else {
+                        skyBottomLineCalculator.updateSkyLineWithWedge(this.lines[0].Start, this.lines[0].End);
+                    }
                 } else {
                 } else {
                     const yValue: number = this.label.PositionAndShape.BorderMarginTop + this.label.PositionAndShape.RelativePosition.y;
                     const yValue: number = this.label.PositionAndShape.BorderMarginTop + this.label.PositionAndShape.RelativePosition.y;
                     skyBottomLineCalculator.updateSkyLineInRange(left, right, yValue);
                     skyBottomLineCalculator.updateSkyLineInRange(left, right, yValue);
@@ -80,7 +84,11 @@ export class GraphicalContinuousDynamicExpression extends AbstractGraphicalExpre
                 break;
                 break;
             case PlacementEnum.Below:
             case PlacementEnum.Below:
                 if (!this.IsVerbal) {
                 if (!this.IsVerbal) {
-                    skyBottomLineCalculator.updateBottomLineWithWedge(this.lines[1].Start, this.lines[1].End);
+                    if (this.ContinuousDynamic.DynamicType === ContDynamicEnum.diminuendo) {
+                        skyBottomLineCalculator.updateBottomLineWithWedge(this.lines[1].End, this.lines[1].Start);
+                    } else {
+                        skyBottomLineCalculator.updateBottomLineWithWedge(this.lines[1].Start, this.lines[1].End);
+                    }
                 } else {
                 } else {
                     const yValue: number = this.label.PositionAndShape.BorderMarginBottom + this.label.PositionAndShape.RelativePosition.y;
                     const yValue: number = this.label.PositionAndShape.BorderMarginBottom + this.label.PositionAndShape.RelativePosition.y;
                     skyBottomLineCalculator.updateBottomLineInRange(left, right, yValue);
                     skyBottomLineCalculator.updateBottomLineInRange(left, right, yValue);