From fd1173e1134d2653cc7da0023c7ab15f06e4b90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Luis=20Monta=C3=B1es?= Date: Thu, 19 Mar 2026 22:37:40 +0100 Subject: [PATCH] Fix waveform auto-scroll: always follow regardless of zoom level Remove conditional that could skip scroll update when zooming. Co-Authored-By: Claude Opus 4.6 --- js/waveform.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/js/waveform.js b/js/waveform.js index 6bb163e..6911c7f 100644 --- a/js/waveform.js +++ b/js/waveform.js @@ -132,11 +132,8 @@ export function drawWaveforms() { // Visible width in steps const visibleSteps = wc.width / pxPerStep; - // Auto-scroll: always follow the latest data - if (totalPx > wc.width) { - state.waveScroll = state.timeStep - visibleSteps; - } - state.waveScroll = Math.max(0, state.waveScroll); + // Auto-scroll: always follow the latest data, keep cursor at right edge + state.waveScroll = Math.max(0, state.timeStep - visibleSteps); // Helper: convert simulation step to pixel X const tToX = (t) => (t - state.waveScroll) * pxPerStep;