Преглед на файлове

fix(skyline) Fix skyline not being created for slurs properly
Needed to multiply by the bezier curve step size.
Add little comment that clarifies loop behavior

Justin Litten преди 5 години
родител
ревизия
39bf4583e2
променени са 2 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 1 1
      src/MusicalScore/Graphical/GraphicalCurve.ts
  2. 2 1
      src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer.ts

+ 1 - 1
src/MusicalScore/Graphical/GraphicalCurve.ts

@@ -33,7 +33,7 @@ export class GraphicalCurve {
      * @param relativePosition
      */
     public calculateCurvePointAtIndex(relativePosition: number): PointF2D {
-        const index: number =  Math.round(relativePosition);
+        const index: number =  Math.round(relativePosition * GraphicalCurve.bezierCurveStepSize);
         if (index < 0 || index >= GraphicalCurve.bezierCurveStepSize) {
             return new PointF2D();
         }

+ 2 - 1
src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer.ts

@@ -222,7 +222,8 @@ export class VexFlowMusicSheetDrawer extends MusicSheetDrawer {
     private drawSampledLine(line: number[], startPosition: PointF2D, width: number, color: string = "#FF0000FF"): void {
         const indices: number[] = [];
         let currentValue: number = 0;
-
+        //Loops through bottom line, grabs all indices that don't equal the previously grabbed index
+        //Starting with 0 (gets index of all line changes)
         for (let i: number = 0; i < line.length; i++) {
             if (line[i] !== currentValue) {
                 indices.push(i);