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 <noreply@anthropic.com>
This commit is contained in:
Jose Luis Montañes
2026-03-19 22:37:40 +01:00
parent 18c753cae1
commit fd1173e113

View File

@@ -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;