@@ -18,41 +18,31 @@ export default function drawEQControlPoints(
1818 const controlPointSize = 48 ;
1919 const halfSize = controlPointSize / 2 ;
2020
21- // Draw control points for each equalizer band
2221 frequencies . forEach ( ( freqConfig , index ) => {
2322 if ( AudioManager . equalizer && AudioManager . equalizer . bands [ index ] ) {
2423 const band = AudioManager . equalizer . bands [ index ] ;
2524 const frequency = freqConfig . frequency ;
26-
27- // Get current gain value in dB
2825 const gainValue = band . gain . value ;
2926
30- // Calculate X position based on frequency (logarithmic scale)
3127 const logFreq = Math . log10 ( frequency ) ;
3228 const normalizedPos = ( logFreq - logMin ) / ( logMax - logMin ) ;
3329 let posX = x + ( normalizedPos * width ) ;
3430
35- // Apply custom positioning:
36- // Points 1,2,5 keep their current positions, point 3 goes to center + 96px, point 4 reflects point 2
3731 if ( index === 0 ) {
38- posX += 96 ; // Point 1 (index 0) - keep current position
32+ posX += 96 ;
3933 } else if ( index === 1 ) {
40- posX += 66 ; // Point 2 (index 1) - keep current position
34+ posX += 66 ;
4135 } else if ( index === 2 ) {
42- posX = x + width / 2 + 59 ; // Point 3 (index 2) - center + 86px to the right
36+ posX = x + width / 2 + 59 ;
4337 } else if ( index === 3 ) {
44- // Point 4 (index 3) - reflect point 2's position
45- posX -= 18 ; // Reflect point 2's position
38+ posX -= 18 ;
4639 } else {
47- posX -= 96 ; // Point 5 (index 4) - keep current position
40+ posX -= 96 ;
4841 }
4942
50- // Calculate Y position based on gain value
51- // Assuming ±12dB range for display
52- const normalizedGain = gainValue / 12 ; // -1 to 1 range
43+ const normalizedGain = gainValue / 12 ;
5344 const posY = y + height / 2 - ( normalizedGain * height / 2 ) ;
5445
55- // Draw outer circle (border)
5646 ctx . beginPath ( ) ;
5747 ctx . arc ( posX , posY , halfSize , 0 , Math . PI * 2 ) ;
5848 ctx . fillStyle = fillColor ;
0 commit comments