From b9b7be2aa46f9aca8f3f4b7b60cd7217276e50dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cchrisshank=E2=80=9D?= Date: Fri, 20 Dec 2024 14:52:00 -0800 Subject: [PATCH] fix raf --- website/canvas/event-propagators-with-device-gravity.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/canvas/event-propagators-with-device-gravity.html b/website/canvas/event-propagators-with-device-gravity.html index e7dc5f7..03386a2 100644 --- a/website/canvas/event-propagators-with-device-gravity.html +++ b/website/canvas/event-propagators-with-device-gravity.html @@ -77,6 +77,7 @@ rotation: from.x" * 270 -> 3000, 0 */ function tick() { + requestAnimationFrame(tick); if (orientationEvent === undefined) return; window.alpha.textContent = orientationEvent.alpha.toFixed(2); @@ -86,7 +87,6 @@ rotation: from.x" // if (event.alpha) { // // ropes.forEach(rope => { rope.gravity = { x: 0, y: 0} }) // } - requestAnimationFrame(tick); } tick();