Pārlūkot izejas kodu

Added scroll to the cursor upon each update, if enabled

praisethemoon 6 gadi atpakaļ
vecāks
revīzija
5a0d80bded
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3 1
      src/OpenSheetMusicDisplay/Cursor.ts

+ 3 - 1
src/OpenSheetMusicDisplay/Cursor.ts

@@ -102,7 +102,9 @@ export class Cursor {
       cursorElement.width = newWidth;
       this.updateStyle(newWidth);
     }
-
+    if (this.openSheetMusicDisplay.FollowCursor) {
+      this.cursorElement.scrollIntoView({behavior: "smooth", block: "center"});
+    }
     // Show cursor
     // // Old cursor: this.graphic.Cursors.push(cursor);
     this.cursorElement.style.display = "";