From 998cd53ffe6ccfb2e4888f857f8c5d05e46d67fb Mon Sep 17 00:00:00 2001 From: LucasDLTG Date: Sun, 25 Oct 2026 16:43:28 +0100 Subject: [PATCH] fix: Y labels on gain graphs --- src/features/dsp408/components/GainSection/GainGraph.tsx | 3 +-- src/features/dsp408/components/GainSection/GainSection.tsx | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/features/dsp408/components/GainSection/GainGraph.tsx b/src/features/dsp408/components/GainSection/GainGraph.tsx index fa9f22d..3018262 100644 --- a/src/features/dsp408/components/GainSection/GainGraph.tsx +++ b/src/features/dsp408/components/GainSection/GainGraph.tsx @@ -68,8 +68,7 @@ function buildCurvesForChannels( } const formatX = (v: number) => Math.round(v).toString(); -export const formatOutputY = (v: number) => Math.round(v).toString(); -export const formatInputY = (v: number) => { +export const formatY = (v: number) => { if (v === 0) return '0'; if (v > 0) return v % 12 === 0 ? `+${Math.round(v)}` : ''; return Math.abs(v) % 15 === 0 ? Math.round(v).toString() : ''; diff --git a/src/features/dsp408/components/GainSection/GainSection.tsx b/src/features/dsp408/components/GainSection/GainSection.tsx index f2f8191..858888e 100644 --- a/src/features/dsp408/components/GainSection/GainSection.tsx +++ b/src/features/dsp408/components/GainSection/GainSection.tsx @@ -17,7 +17,7 @@ import { CurvePoint, sumCurvePoints } from '../../utils/graph/curve'; import { getGeqCurvePoints } from '../../utils/graph/geq'; import { getPeqCurvePoints } from '../../utils/graph/peq'; import { getCrossoverCurvePoints } from '../../utils/graph/crossover'; -import { ChannelCurves, formatInputY, formatOutputY, ResponseGraph } from './GainGraph'; +import { ChannelCurves, formatY, ResponseGraph } from './GainGraph'; // ---- Curve construction ----------------------------------------------- @@ -336,7 +336,7 @@ function GainSection({ showStages={showInputStages} liveGains={liveInputGains} getChannelCurves={getInputChannelCurves} - formatY={formatInputY} + formatY={formatY} /> @@ -369,7 +369,7 @@ function GainSection({ showStages={showOutputStages} liveGains={liveOutputGains} getChannelCurves={getOutputChannelCurves} - formatY={formatOutputY} + formatY={formatY} />