summaryrefslogtreecommitdiff
path: root/apps/web/src/hooks/timeline/use-timeline-playhead.ts
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-02-23 10:55:35 +0100
committerMaze Winther <mazewinther@gmail.com>2026-02-23 10:55:35 +0100
commit4d77e3f2bb9884ad9e43761eaf0ede8c1a9cfccc (patch)
treecac5f7d98325504ec2c579eb0045e1adf1f83139 /apps/web/src/hooks/timeline/use-timeline-playhead.ts
parentab64c48c92f13434f988628a2e5ecf53063d0949 (diff)
downloadopencut-4d77e3f2bb9884ad9e43761eaf0ede8c1a9cfccc.tar.gz
refactor: snapping system
Diffstat (limited to 'apps/web/src/hooks/timeline/use-timeline-playhead.ts')
-rw-r--r--apps/web/src/hooks/timeline/use-timeline-playhead.ts12
1 files changed, 5 insertions, 7 deletions
diff --git a/apps/web/src/hooks/timeline/use-timeline-playhead.ts b/apps/web/src/hooks/timeline/use-timeline-playhead.ts
index 1e536dae..d6bb29e2 100644
--- a/apps/web/src/hooks/timeline/use-timeline-playhead.ts
+++ b/apps/web/src/hooks/timeline/use-timeline-playhead.ts
@@ -3,7 +3,10 @@ import { useState, useEffect, useCallback, useRef } from "react";
import { useEdgeAutoScroll } from "@/hooks/timeline/use-edge-auto-scroll";
import { useEditor } from "../use-editor";
import { useShiftKey } from "@/hooks/use-shift-key";
-import { useTimelineSnapping } from "@/hooks/timeline/use-timeline-snapping";
+import {
+ findSnapPoints,
+ snapToNearestPoint,
+} from "@/lib/timeline/snap-utils";
import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants";
interface UseTimelinePlayheadProps {
@@ -28,10 +31,6 @@ export function useTimelinePlayhead({
const isPlaying = editor.playback.getIsPlaying();
const isScrubbing = editor.playback.getIsScrubbing();
const isShiftHeldRef = useShiftKey();
- const { snapToNearestPoint, findSnapPoints } = useTimelineSnapping({
- enableElementSnapping: true,
- enablePlayheadSnapping: false,
- });
const seek = useCallback(
({ time }: { time: number }) => editor.playback.seek({ time }),
@@ -87,6 +86,7 @@ export function useTimelinePlayhead({
tracks,
playheadTime: frameTime,
bookmarks,
+ enablePlayheadSnapping: false,
});
const snapResult = snapToNearestPoint({
targetTime: frameTime,
@@ -110,8 +110,6 @@ export function useTimelinePlayhead({
isShiftHeldRef,
editor.scenes,
editor.timeline,
- findSnapPoints,
- snapToNearestPoint,
],
);