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

Added scroll to the cursor upon each update, if enabled

praisethemoon преди 6 години
родител
ревизия
5a0d80bded
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  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 = "";