From 8545d95070890edfcf76b788ee023f9d510c302d Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Sat, 12 Jul 2025 12:48:31 +0200 Subject: refactor: add FPS and remove turbopack (yes, fuck you turbopack) --- apps/web/src/components/editor/timeline.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'apps/web/src/components/editor/timeline.tsx') diff --git a/apps/web/src/components/editor/timeline.tsx b/apps/web/src/components/editor/timeline.tsx index 4fee16fc..a2b798e1 100644 --- a/apps/web/src/components/editor/timeline.tsx +++ b/apps/web/src/components/editor/timeline.tsx @@ -81,14 +81,8 @@ export function Timeline() { } = useTimelineStore(); const { mediaItems, addMediaItem } = useMediaStore(); const { activeProject } = useProjectStore(); - const { - currentTime, - duration, - seek, - setDuration, - isPlaying, - toggle, - } = usePlaybackStore(); + const { currentTime, duration, seek, setDuration, isPlaying, toggle } = + usePlaybackStore(); const [isDragOver, setIsDragOver] = useState(false); const [isProcessing, setIsProcessing] = useState(false); const [progress, setProgress] = useState(0); @@ -215,7 +209,7 @@ export function Timeline() { scrollLeft = tracksContent.scrollLeft; } - const time = Math.max( + const rawTime = Math.max( 0, Math.min( duration, @@ -224,6 +218,11 @@ export function Timeline() { ) ); + // Use frame snapping for timeline clicking + const projectFps = activeProject?.fps || 30; + const { snapTimeToFrame } = require("@/constants/timeline-constants"); + const time = snapTimeToFrame(rawTime, projectFps); + seek(time); }, [ -- cgit v1.3.1