Add RED.view.DEBUG_SYNC_REDRAW to disable requestAnimationFrame

References #2631
This commit is contained in:
Nick O'Leary 2020-07-06 21:01:14 +01:00
parent 57154b2853
commit 64ec415a54
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 10 additions and 1 deletions

View File

@ -3398,8 +3398,17 @@ RED.view = (function() {
}
var pendingRedraw;
function redraw() {
requestAnimationFrame(_redraw);
if (RED.view.DEBUG_SYNC_REDRAW) {
_redraw();
} else {
if (pendingRedraw) {
cancelAnimationFrame(pendingRedraw);
}
pendingRedraw = requestAnimationFrame(_redraw);
}
}
function _redraw() {