clamp input

pull/276/head
Mikael Finstad 6 years ago
parent 3ad0a0c9bc
commit 3bb03305fc

@ -310,9 +310,11 @@ const App = memo(() => {
if (type === 'end' && time <= getSegApparentStart(currentSeg)) {
throw new Error('Start time must precede end time');
}
cloned[currentSegIndexSafe][type] = time;
cloned[currentSegIndexSafe][type] = Math.min(Math.max(time, 0), duration);
setCutSegments(cloned);
}, [currentSegIndexSafe, getSegApparentEnd, cutSegments, currentCutSeg, setCutSegments]);
}, [
currentSegIndexSafe, getSegApparentEnd, cutSegments, currentCutSeg, setCutSegments, duration,
]);
function formatTimecode(sec) {
return formatDuration({ seconds: sec, fps: timecodeShowFrames ? detectedFps : undefined });

Loading…
Cancel
Save