From 4103e6e3eb0bfbf53aa2a75a9cf3f52c5ede33aa Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Thu, 5 Dec 2024 13:27:03 -0500 Subject: [PATCH] fix: animation frames --- .changeset/slimy-mails-trade.md | 5 +++++ .../lib/utilities/AnimationFrames/AnimationFrames.svelte.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/slimy-mails-trade.md diff --git a/.changeset/slimy-mails-trade.md b/.changeset/slimy-mails-trade.md new file mode 100644 index 00000000..6fee50cb --- /dev/null +++ b/.changeset/slimy-mails-trade.md @@ -0,0 +1,5 @@ +--- +"runed": patch +--- + +fix: `AnimationFrames` diff --git a/packages/runed/src/lib/utilities/AnimationFrames/AnimationFrames.svelte.ts b/packages/runed/src/lib/utilities/AnimationFrames/AnimationFrames.svelte.ts index e03d9456..cb73a1df 100644 --- a/packages/runed/src/lib/utilities/AnimationFrames/AnimationFrames.svelte.ts +++ b/packages/runed/src/lib/utilities/AnimationFrames/AnimationFrames.svelte.ts @@ -60,7 +60,7 @@ export class AnimationFrames { }); } - #loop(timestamp: DOMHighResTimeStamp): void { + #loop = (timestamp: DOMHighResTimeStamp): void => { if (!this.#running) return; if (this.#previousTimestamp === null) { @@ -78,7 +78,7 @@ export class AnimationFrames { this.#previousTimestamp = timestamp; this.#callback({ delta, timestamp }); this.#frame = requestAnimationFrame(this.#loop); - } + }; start(): void { this.#running = true;