diff --git a/components/tracks/Track.tsx b/components/tracks/Track.tsx index 7cce716..9f0b7db 100644 --- a/components/tracks/Track.tsx +++ b/components/tracks/Track.tsx @@ -84,8 +84,12 @@ export function Track({ const ctx = canvas.getContext('2d'); if (!ctx) return; + // Use parent container's size since canvas is absolute positioned + const parent = canvas.parentElement; + if (!parent) return; + const dpr = window.devicePixelRatio || 1; - const rect = canvas.getBoundingClientRect(); + const rect = parent.getBoundingClientRect(); canvas.width = rect.width * dpr; canvas.height = rect.height * dpr; @@ -147,7 +151,7 @@ export function Track({ ctx.lineTo(playheadX, height); ctx.stroke(); } - }, [track.audioBuffer, track.color, track.collapsed, zoom, currentTime, duration]); + }, [track.audioBuffer, track.color, track.collapsed, track.height, zoom, currentTime, duration]); const handleCanvasClick = (e: React.MouseEvent) => { if (!onSeek || !duration) return; @@ -216,6 +220,33 @@ export function Track({ )} + {/* Solo Button */} + + + {/* Mute Button */} + + + {/* Remove Button */} - - )}