mirror of
https://codeberg.org/armin/noiz.git
synced 2026-09-01 05:50:52 +02:00
Fix analyzer bar gaps to exactly 6px
This commit is contained in:
parent
34c0a4ccf4
commit
6ee9b976bd
1 changed files with 3 additions and 3 deletions
|
|
@ -514,8 +514,8 @@ function drawSpectrum() {
|
||||||
grad.addColorStop(0.4, '#84a0c6');
|
grad.addColorStop(0.4, '#84a0c6');
|
||||||
grad.addColorStop(1, '#272c42');
|
grad.addColorStop(1, '#272c42');
|
||||||
const smoothFactor = barDecay;
|
const smoothFactor = barDecay;
|
||||||
const barW = Math.max(1, Math.floor(w / NUM_BARS * 0.75));
|
const gap = 6;
|
||||||
const gap = Math.max(1, Math.floor(w / NUM_BARS * 0.25));
|
const barW = Math.max(1, Math.floor((w - (NUM_BARS - 1) * gap) / NUM_BARS));
|
||||||
const totalBar = barW + gap;
|
const totalBar = barW + gap;
|
||||||
const offset = Math.floor((w - NUM_BARS * totalBar + gap) / 2);
|
const offset = Math.floor((w - NUM_BARS * totalBar + gap) / 2);
|
||||||
for (let i = 0; i < NUM_BARS; i++) {
|
for (let i = 0; i < NUM_BARS; i++) {
|
||||||
|
|
@ -561,7 +561,7 @@ function drawSpectrum() {
|
||||||
const gap = 4;
|
const gap = 4;
|
||||||
const labelW = 12;
|
const labelW = 12;
|
||||||
const segCount = 32;
|
const segCount = 32;
|
||||||
const segG = 2;
|
const segG = 6;
|
||||||
const segW = Math.floor((vw - labelW - (segCount - 1) * segG) / segCount);
|
const segW = Math.floor((vw - labelW - (segCount - 1) * segG) / segCount);
|
||||||
const totalSegW = segCount * segW + (segCount - 1) * segG;
|
const totalSegW = segCount * segW + (segCount - 1) * segG;
|
||||||
const segLeft = labelW + Math.floor(((vw - labelW) - totalSegW) / 2);
|
const segLeft = labelW + Math.floor(((vw - labelW) - totalSegW) / 2);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue