Browse Source

don't cause render when setting osmd.DrawSkyLine (or DrawBottomLine)

sschmid 5 năm trước cách đây
mục cha
commit
3b65493dda
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      src/OpenSheetMusicDisplay/OpenSheetMusicDisplay.ts

+ 4 - 2
src/OpenSheetMusicDisplay/OpenSheetMusicDisplay.ts

@@ -837,7 +837,8 @@ export class OpenSheetMusicDisplay {
         this.drawSkyLine = value;
         if (this.drawer) {
             this.drawer.skyLineVisible = value;
-            this.render();
+            // this.render(); // note: we probably shouldn't automatically render when someone sets the setter
+            //   this can cause a lot of rendering time.
         }
     }
     public get DrawSkyLine(): boolean {
@@ -848,7 +849,8 @@ export class OpenSheetMusicDisplay {
         this.drawBottomLine = value;
         if (this.drawer) {
             this.drawer.bottomLineVisible = value;
-            this.render();
+            // this.render(); // note: we probably shouldn't automatically render when someone sets the setter
+            //   this can cause a lot of rendering time.
         }
     }
     public get DrawBottomLine(): boolean {