From e2d4057f67893f27695779662e7199007cb2d981 Mon Sep 17 00:00:00 2001 From: Ayabusa Date: Mon, 6 Apr 2026 14:17:10 +0200 Subject: [PATCH] Fixed arrows broken on resize or img load --- projects/script.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/script.js b/projects/script.js index 41903eb..bba15a0 100644 --- a/projects/script.js +++ b/projects/script.js @@ -112,5 +112,7 @@ document.querySelectorAll('.node').forEach(node => { }); // ─── Initial draw ───────────────────────────────────────────── -// Wait two frames so the browser has laid out the divs -requestAnimationFrame(() => requestAnimationFrame(redraw)); +window.addEventListener('load', redraw); + +// also redraws if anything inside the scene changes size +new ResizeObserver(redraw).observe(scene);