double-timeout on debug tile fading - helps when rendering goes slow

This commit is contained in:
Jon Atkins 2014-03-17 07:07:02 +00:00
parent 3232aa5c10
commit 246fa1a7d7

View File

@ -72,8 +72,11 @@ window.RenderDebugTiles.prototype.setState = function(id,state) {
window.RenderDebugTiles.prototype.startTimer = function(waitTime) {
var _this = this;
if (!this.timer) {
this.timer = setTimeout ( function() { _this.timer = undefined; _this.runClearPass(); }, waitTime );
if (!_this.timer) {
// a timeout of 0 firing the actual timeout - helps things run smoother
_this.timer = setTimeout ( function() {
_this.timer = setTimeout ( function() { _this.timer = undefined; _this.runClearPass(); }, waitTime );
}, 0);
}
}