diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-02-23 10:55:35 +0100 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-02-23 10:55:35 +0100 |
| commit | 4d77e3f2bb9884ad9e43761eaf0ede8c1a9cfccc (patch) | |
| tree | cac5f7d98325504ec2c579eb0045e1adf1f83139 /apps/web/src/hooks/timeline/use-timeline-playhead.ts | |
| parent | ab64c48c92f13434f988628a2e5ecf53063d0949 (diff) | |
| download | opencut-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.ts | 12 |
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, ], ); |
