From b80a9e4e86ba56e54264c2fee6acc7d05d5b7182 Mon Sep 17 00:00:00 2001 From: w1n5t0n Date: Sun, 22 Mar 2026 01:07:52 +0200 Subject: [PATCH] fix(playground): resize canvas when switching output modes in Design B (meml-2c3) When switching from synth back to visual mode, the FlowFieldVisualizer canvas had stale dimensions from being hidden. Add requestAnimationFrame resize call after toggling canvas visibility so the visualizer picks up correct dimensions and renders properly. --- .beads/dolt-monitor.pid.lock | 0 playground/js/b-app.js | 10 ++++++++++ 2 files changed, 10 insertions(+) delete mode 100644 .beads/dolt-monitor.pid.lock diff --git a/.beads/dolt-monitor.pid.lock b/.beads/dolt-monitor.pid.lock deleted file mode 100644 index e69de29..0000000 diff --git a/playground/js/b-app.js b/playground/js/b-app.js index ef937fd..665ada2 100644 --- a/playground/js/b-app.js +++ b/playground/js/b-app.js @@ -906,6 +906,16 @@ function setOutputMode(mode) { document.getElementById('toggle-visual').classList.toggle('active', mode === 'visual'); document.getElementById('toggle-synth').classList.toggle('active', mode === 'synth'); + // Resize the now-visible canvas so it picks up correct dimensions + if (mode === 'visual') { + requestAnimationFrame(() => { + visualizer.resize(); + visualizer.initParticles(); + }); + } else if (synthVisualizer) { + requestAnimationFrame(() => synthVisualizer._resize()); + } + buildParamGroups(); const outputs = iml.getOutputs(); updateAllParamBars(outputs);