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;