Explorar o código

Added scroll to the cursor upon each update, if enabled

praisethemoon %!s(int64=6) %!d(string=hai) anos
pai
achega
5a0d80bded
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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 = "";