speed zones work now
This commit is contained in:
@ -127,7 +127,6 @@ export default function WaveformTimeline({
|
||||
const videoPath = useEditorStore((s) => s.videoPath);
|
||||
const backendUrl = useEditorStore((s) => s.backendUrl);
|
||||
const duration = useEditorStore((s) => s.duration);
|
||||
const deletedRanges = useEditorStore((s) => s.deletedRanges);
|
||||
const cutRanges = useEditorStore((s) => s.cutRanges);
|
||||
const muteRanges = useEditorStore((s) => s.muteRanges);
|
||||
const gainRanges = useEditorStore((s) => s.gainRanges);
|
||||
@ -322,13 +321,6 @@ export default function WaveformTimeline({
|
||||
const waveTop = RULER_H + 1;
|
||||
const waveH = height - waveTop;
|
||||
|
||||
for (const range of deletedRanges) {
|
||||
const x1 = (range.start - scroll) * pxPerSec;
|
||||
const x2 = (range.end - scroll) * pxPerSec;
|
||||
ctx.fillStyle = 'rgba(239, 68, 68, 0.15)';
|
||||
ctx.fillRect(x1, waveTop, x2 - x1, waveH);
|
||||
}
|
||||
|
||||
// Draw cut ranges (red overlays)
|
||||
for (const range of showCutZones ? cutRanges : []) {
|
||||
const x1 = (range.start - scroll) * pxPerSec;
|
||||
@ -430,9 +422,9 @@ export default function WaveformTimeline({
|
||||
ctx.fillStyle = '#d1fae5';
|
||||
ctx.font = '10px sans-serif';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.textBaseline = 'top';
|
||||
if (centerX > 12 && centerX < width - 12) {
|
||||
ctx.fillText(`${range.speed.toFixed(2)}x`, centerX, waveTop + waveH / 2);
|
||||
ctx.fillText(`${range.speed.toFixed(2)}x`, centerX, waveTop + 4);
|
||||
}
|
||||
ctx.textAlign = 'start';
|
||||
ctx.textBaseline = 'alphabetic';
|
||||
@ -483,7 +475,6 @@ export default function WaveformTimeline({
|
||||
}
|
||||
ctx.stroke();
|
||||
}, [
|
||||
deletedRanges,
|
||||
cutRanges,
|
||||
muteRanges,
|
||||
gainRanges,
|
||||
@ -506,7 +497,7 @@ export default function WaveformTimeline({
|
||||
drawStaticWaveformRef.current = drawStaticWaveform;
|
||||
}, [drawStaticWaveform]);
|
||||
|
||||
// Redraw static layer when deletedRanges change
|
||||
// Redraw static layer when cutRanges change
|
||||
useEffect(() => {
|
||||
drawStaticWaveform();
|
||||
}, [drawStaticWaveform]);
|
||||
|
||||
Reference in New Issue
Block a user