Fixed arrows broken on resize or img load
This commit is contained in:
@@ -112,5 +112,7 @@ document.querySelectorAll('.node').forEach(node => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// ─── Initial draw ─────────────────────────────────────────────
|
// ─── Initial draw ─────────────────────────────────────────────
|
||||||
// Wait two frames so the browser has laid out the divs
|
window.addEventListener('load', redraw);
|
||||||
requestAnimationFrame(() => requestAnimationFrame(redraw));
|
|
||||||
|
// also redraws if anything inside the scene changes size
|
||||||
|
new ResizeObserver(redraw).observe(scene);
|
||||||
|
|||||||
Reference in New Issue
Block a user