fix: draw over bounds

This commit is contained in:
2026-09-12 11:22:27 +02:00
parent 19c3aedf80
commit 0f198692ad
3 changed files with 31 additions and 12 deletions
@@ -413,7 +413,7 @@ function GainSection({
const { yMin: inputYMin, yMax: inputYMax } = computeYAxisBounds(
inputCurves,
GRAPH_Y_MIN,
GRAPH_Y_MAX,
12,
Y_AXIS_STEP
);
const { yMin: outputYMin, yMax: outputYMax } = computeYAxisBounds(
@@ -457,7 +457,18 @@ function GainSection({
yLabel="dB"
showGrid={true}
formatX={(v) => Math.round(v).toString()}
formatY={(v) => Math.round(v).toString()}
formatY={(v) => {
// Always label 0.
if (v === 0) return '0';
// Positive side: label every 12 dB.
if (v > 0) {
return v % 12 === 0 ? `+${Math.round(v)}` : '';
}
// Negative side: label every 15 dB.
return Math.abs(v) % 15 === 0 ? Math.round(v).toString() : '';
}}
draw={({ ctx, toPx }) => {
drawCurves({
ctx,