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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user