Add peak hold decay rate selector

Introduce a new dropdown to control how fast the peak-hold line
decays on the live spectrum. Options:
  Off   — peaks never decay (manual reset only)
  Slow  — slow fade (0.005/frame)
  Medium — moderate fade (0.015/frame, matches previous fixed rate)
  Fast   — quick fade (0.03/frame)

Previously the decay rate was hardcoded at 0.015/frame.
This commit is contained in:
Armin 2026-07-06 18:09:41 +02:00
commit e159b76e0d
2 changed files with 9 additions and 1 deletions

View file

@ -616,7 +616,9 @@ const App = {
ctx.stroke();
if (this.holdPeaks) {
const decay = 0.015;
const decaySel = document.getElementById('peakHoldDecay');
const decayMap = { off: 0, slow: 0.005, medium: 0.015, fast: 0.03 };
const decay = decaySel ? (decayMap[decaySel.value] ?? 0.015) : 0.015;
ctx.beginPath();
let started = false;
for (let x = 0; x < chartW; x++) {