fix: move computing spectrogram text to the center of current viewport of piano roll window

This commit is contained in:
Xiaohan-Tian
2026-05-02 00:09:33 -07:00
parent 5890a6d0b9
commit 6b8a470022
4 changed files with 89 additions and 62 deletions
+3
View File
@@ -34,6 +34,7 @@ interface PianoGridProps {
spectrogramPower?: number;
pianoRollZoom?: number;
mode?: 'midi-edit' | 'spectrogram' | 'hybrid';
onSpectrogramLoadingChange?: (loading: boolean) => void;
}
interface CursorPosition {
@@ -62,6 +63,7 @@ const PianoGrid: React.FC<PianoGridProps> = ({
spectrogramThresholdDb = -25,
spectrogramPower = 0.5,
pianoRollZoom = 1,
onSpectrogramLoadingChange,
}) => {
const [cursorPosition, setCursorPosition] = useState<CursorPosition | null>(null);
const [isModifierPressed, setIsModifierPressed] = useState(false);
@@ -243,6 +245,7 @@ const PianoGrid: React.FC<PianoGridProps> = ({
thresholdDb={spectrogramThresholdDb}
power={spectrogramPower}
zoom={pianoRollZoom}
onLoadingChange={onSpectrogramLoadingChange}
/>
)}