From f7957d3aa080dcdfc4c6450ff2590c101b71d94b Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 9 Nov 2022 23:44:26 +0000 Subject: js: Reinstate a missing variable declaration ... and then decide there was no excuse for renaming the variable, so now it has the same name it had before I started using Window.requestAnimationFrame(). --- emcclib.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'emcclib.js') diff --git a/emcclib.js b/emcclib.js index 497451a..8da9dba 100644 --- a/emcclib.js +++ b/emcclib.js @@ -200,16 +200,16 @@ mergeInto(LibraryManager.library, { if (!timer_active) { timer_reference = performance.now(); var frame = function(now) { - current_timer = null; + timer = null; timer_callback((now - timer_reference) / 1000.0); /* The callback may have deactivated the timer. */ if (timer_active) { timer_reference = now; - current_timer = window.requestAnimationFrame(frame); + timer = window.requestAnimationFrame(frame); } } timer_active = true; - current_timer = window.requestAnimationFrame(frame); + timer = window.requestAnimationFrame(frame); } }, @@ -221,9 +221,9 @@ mergeInto(LibraryManager.library, { js_deactivate_timer: function() { if (timer_active) { timer_active = false; - if (current_timer !== null) { - window.cancelAnimationFrame(current_timer); - current_timer = null; + if (timer !== null) { + window.cancelAnimationFrame(timer); + timer = null; } } }, -- cgit v1.1