From 246fa1a7d7879cbb1818686bedcc6f7c4ae53bdd Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Mon, 17 Mar 2014 07:07:02 +0000 Subject: [PATCH] double-timeout on debug tile fading - helps when rendering goes slow --- code/map_data_debug.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/map_data_debug.js b/code/map_data_debug.js index 7796b809..0aff2b37 100644 --- a/code/map_data_debug.js +++ b/code/map_data_debug.js @@ -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); } }