aboutsummaryrefslogtreecommitdiff
path: root/emcclib.js
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2022-11-09 23:44:26 +0000
committerBen Harris <bjh21@bjh21.me.uk>2022-11-09 23:44:26 +0000
commitf7957d3aa080dcdfc4c6450ff2590c101b71d94b (patch)
treeb32b3858da73d0533ed968681a518f9ae7ecf8be /emcclib.js
parent7982002a644328164bf0f77bf489876ad012e90d (diff)
downloadpuzzles-f7957d3aa080dcdfc4c6450ff2590c101b71d94b.zip
puzzles-f7957d3aa080dcdfc4c6450ff2590c101b71d94b.tar.gz
puzzles-f7957d3aa080dcdfc4c6450ff2590c101b71d94b.tar.bz2
puzzles-f7957d3aa080dcdfc4c6450ff2590c101b71d94b.tar.xz
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().
Diffstat (limited to 'emcclib.js')
-rw-r--r--emcclib.js12
1 files changed, 6 insertions, 6 deletions
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;
}
}
},