瀏覽代碼

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 = "";