mirror of
https://codeberg.org/armin/noiz.git
synced 2026-09-01 14:00:54 +02:00
clamp VU meter peak indicator to last valid LED index to prevent cut-off 33rd position
This commit is contained in:
parent
965674c777
commit
94ee52aace
1 changed files with 2 additions and 2 deletions
|
|
@ -616,8 +616,8 @@ function drawSpectrum() {
|
||||||
else { vuPeakR *= 0.990; }
|
else { vuPeakR *= 0.990; }
|
||||||
drawVuRow(0, levelL);
|
drawVuRow(0, levelL);
|
||||||
drawVuRow(gap + rowH, levelR);
|
drawVuRow(gap + rowH, levelR);
|
||||||
const piL = Math.round(vuPeakL * segCount);
|
const piL = Math.min(segCount - 1, Math.round(vuPeakL * segCount));
|
||||||
const piR = Math.round(vuPeakR * segCount);
|
const piR = Math.min(segCount - 1, Math.round(vuPeakR * segCount));
|
||||||
if (vuPeakL > 0.05) {
|
if (vuPeakL > 0.05) {
|
||||||
vuctx.fillStyle = '#e98989';
|
vuctx.fillStyle = '#e98989';
|
||||||
vuctx.fillRect(segLeft + piL * (segW + segG), 0, segW, rowH);
|
vuctx.fillRect(segLeft + piL * (segW + segG), 0, segW, rowH);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue