fix: remove alert(), fix waveform zoom, add waveform scroll (wheel + ctrl+wheel)
This commit is contained in:
@@ -121,11 +121,14 @@ export function drawWaveforms() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Auto-scroll to show latest
|
||||
// Auto-scroll to show latest (only if we're already near the end)
|
||||
const maxVisible = Math.floor(wc.width / state.waveZoom);
|
||||
if (state.timeStep > maxVisible) {
|
||||
const isNearEnd = state.waveScroll >= state.timeStep - maxVisible - 2;
|
||||
if (state.timeStep > maxVisible && isNearEnd) {
|
||||
state.waveScroll = state.timeStep - maxVisible;
|
||||
}
|
||||
// Clamp scroll to valid range
|
||||
state.waveScroll = Math.max(0, Math.min(state.timeStep - 1, state.waveScroll));
|
||||
|
||||
// Draw time grid
|
||||
wctx.strokeStyle = '#151520';
|
||||
|
||||
Reference in New Issue
Block a user