annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
222
84844649a8fd continued: reusable applications
am@osimis.io
parents:
diff changeset
1 var isPendingRedraw = false;
84844649a8fd continued: reusable applications
am@osimis.io
parents:
diff changeset
2
84844649a8fd continued: reusable applications
am@osimis.io
parents:
diff changeset
3 function ScheduleRedraw()
84844649a8fd continued: reusable applications
am@osimis.io
parents:
diff changeset
4 {
84844649a8fd continued: reusable applications
am@osimis.io
parents:
diff changeset
5 if (!isPendingRedraw) {
84844649a8fd continued: reusable applications
am@osimis.io
parents:
diff changeset
6 isPendingRedraw = true;
84844649a8fd continued: reusable applications
am@osimis.io
parents:
diff changeset
7 //console.log('Scheduling a refresh of the viewport, as its content changed');
84844649a8fd continued: reusable applications
am@osimis.io
parents:
diff changeset
8 window.requestAnimationFrame(function() {
84844649a8fd continued: reusable applications
am@osimis.io
parents:
diff changeset
9 isPendingRedraw = false;
84844649a8fd continued: reusable applications
am@osimis.io
parents:
diff changeset
10 viewport.Redraw();
84844649a8fd continued: reusable applications
am@osimis.io
parents:
diff changeset
11 });
84844649a8fd continued: reusable applications
am@osimis.io
parents:
diff changeset
12 }
84844649a8fd continued: reusable applications
am@osimis.io
parents:
diff changeset
13 }