diff Platforms/WebAssembly/defaults.js @ 222:84844649a8fd am

continued: reusable applications
author am@osimis.io
date Tue, 12 Jun 2018 17:21:15 +0200
parents
children b0ba3b38a23c
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Platforms/WebAssembly/defaults.js	Tue Jun 12 17:21:15 2018 +0200
@@ -0,0 +1,13 @@
+var isPendingRedraw = false;
+
+function ScheduleRedraw()
+{
+  if (!isPendingRedraw) {
+    isPendingRedraw = true;
+    //console.log('Scheduling a refresh of the viewport, as its content changed');
+    window.requestAnimationFrame(function() {
+      isPendingRedraw = false;
+      viewport.Redraw();
+    });
+  }
+}