Pārlūkot izejas kodu

Merge fix/ui follow cursor performance (#653)

* Saving measures' BPM and fix #557

* Slight improvements, to handle cases where no BPM is mentioned.

* Fixed tiny confusion between `userStartTempoInBPM` and `userStartTempoInBPM`

* Added support for tempo that appears `metronome`

* Improved smoothness of cursor following mechanism.

Co-authored-by: Soulaymen Chouri <doit@praisethemoon.org>
Simon 5 gadi atpakaļ
vecāks
revīzija
9ebf10a0dc
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      src/OpenSheetMusicDisplay/Cursor.ts

+ 2 - 1
src/OpenSheetMusicDisplay/Cursor.ts

@@ -134,7 +134,8 @@ export class Cursor {
       this.updateStyle(newWidth);
     }
     if (this.openSheetMusicDisplay.FollowCursor) {
-      this.cursorElement.scrollIntoView({behavior: "smooth", block: "center"});
+      const diff: number = this.cursorElement.getBoundingClientRect().top;
+      this.cursorElement.scrollIntoView({behavior: diff < 1000 ? "smooth" : "auto", block: "center"});
     }
     // Show cursor
     // // Old cursor: this.graphic.Cursors.push(cursor);