summaryrefslogtreecommitdiff
path: root/apps/web/src/components/editor/timeline.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/src/components/editor/timeline.tsx')
-rw-r--r--apps/web/src/components/editor/timeline.tsx17
1 files changed, 8 insertions, 9 deletions
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);
},
[