fix: velocity flicker - grid canvas useLayoutEffect sync

This commit is contained in:
2026-07-26 10:29:23 +07:00
parent 0b7dd82407
commit d20fafb75e
3 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -4767,7 +4767,7 @@ const PianoRollTabEditor = ({ st, zoom, bpm, viewportWidth, onClose, onUpdateNot
};
}, [notes, st.currentTime, pixelsPerBeat, st.id, totalBeats, bpm]);
React.useEffect(() => {
React.useLayoutEffect(() => {
const canvas = canvasRef.current;
if (!canvas) return;
const ctx = canvas.getContext('2d');