From 50ffd905602fcbbeae564caf31978e6a4912c208 Mon Sep 17 00:00:00 2001 From: Nibu Date: Wed, 4 Nov 2026 18:47:12 +0000 Subject: [PATCH] harness: demo page keeps hold of the canvas it swaps in, so the prepass switch works twice Co-Authored-By: Claude Sonnet 5.5 --- harness/scene/demo.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/harness/scene/demo.ts b/harness/scene/demo.ts index 507692d7..ba88e507 100644 --- a/harness/scene/demo.ts +++ b/harness/scene/demo.ts @@ -3,7 +3,7 @@ import { createScene, Scene, SceneStats, TraceStats } from '../../src/app/features/scene/Scene'; import { LEVELS } from '../../src/app/features/scene/budget'; -const canvas = document.getElementById('c') as HTMLCanvasElement; +let canvas = document.getElementById('c') as HTMLCanvasElement; const out = document.getElementById('out') as HTMLPreElement; const box = document.getElementById('prepass') as HTMLInputElement; const pull = document.getElementById('pull') as HTMLInputElement; @@ -22,6 +22,7 @@ function start() { // A fresh canvas: a context cannot change its attributes, and dispose leaves the old one bound. const fresh = canvas.cloneNode() as HTMLCanvasElement; canvas.replaceWith(fresh); + canvas = fresh; scene = createScene({ canvas: fresh, unthrottled: true,