diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-06 23:16:18 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-06 23:16:18 +0100 |
| commit | 036114d12d024273e752ffbb68a95a04ee34d4fa (patch) | |
| tree | c3b8939480249c22f4b0a2a67a788088e4bd3c85 /src/audio/jittered_audio_backend.cc | |
| parent | 0c98c830b382d66c420524ff395e12164a566dd8 (diff) | |
fix(spectral_editor): Disable vertical zoom/pan for logarithmic frequency axis
Root Cause:
The frequency axis uses logarithmic scale (20 Hz to 16 kHz), but the zoom
calculation was treating it as linear. This caused coordinate calculation
errors when zooming, resulting in curves and frequency ticks moving up
when the content hit the viewport edge.
Changes:
- Zoom now only affects horizontal axis (time/frame)
- Removed vertical zoom (pixelsPerBin changes) during Ctrl/Cmd + wheel
- Disabled vertical pan (normal wheel) for logarithmic mode
- Horizontal pan (Shift + wheel) still works correctly
Explanation:
With logarithmic frequency scale, the frequency range (FREQ_MIN to FREQ_MAX)
is always scaled to fit canvas height. There's no "extra content" to zoom
into vertically. The frequency axis should remain fixed while only the
time axis (which is linear) supports zoom.
The bug manifested as vertical drift because the offset calculation used
linear math (viewportOffsetY = freqUnderCursor * pixelsPerBin - mouseY)
on a logarithmic coordinate system, causing accumulated errors.
Fixes: Curves and frequency ticks now stay stable during horizontal zoom.
Diffstat (limited to 'src/audio/jittered_audio_backend.cc')
0 files changed, 0 insertions, 0 deletions
