Browse Source

Added scroll to the cursor upon each update, if enabled

praisethemoon 6 năm trước cách đây
mục cha
commit
5a0d80bded
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  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 = "";