Explorar el Código

use requestAnimationFrame on desktop

Evan Almloff hace 1 año
padre
commit
71f7481ded
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      packages/desktop/build.rs

+ 3 - 1
packages/desktop/build.rs

@@ -44,7 +44,9 @@ fn main() {
           .then(response => {{
               response.arrayBuffer()
                   .then(bytes => {{
-                      run_from_bytes(bytes);
+                      requestAnimationFrame(() => {{
+                        run_from_bytes(bytes);
+                      }});
                       window.interpreter.wait_for_request();
                   }});
           }})