From 8db3bead13441a5882d8689dfc6a9f09c82375d9 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Wed, 25 Mar 2026 16:47:22 +0100 Subject: feat: masks, properties refactor, shaders, storage migrations, and more --- apps/web/src/hooks/timeline/use-snap-indicator-position.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'apps/web/src/hooks/timeline/use-snap-indicator-position.ts') diff --git a/apps/web/src/hooks/timeline/use-snap-indicator-position.ts b/apps/web/src/hooks/timeline/use-snap-indicator-position.ts index f3e63894..1a8f3c5d 100644 --- a/apps/web/src/hooks/timeline/use-snap-indicator-position.ts +++ b/apps/web/src/hooks/timeline/use-snap-indicator-position.ts @@ -1,13 +1,10 @@ import { useEffect, useState } from "react"; import { timelineTimeToSnappedPixels } from "@/lib/timeline"; -import type { TimelineTrack } from "@/types/timeline"; - +import { TRACK_LABELS_WIDTH_PX } from "@/constants/timeline-constants"; interface UseSnapIndicatorPositionParams { snapPoint: { time: number } | null; zoomLevel: number; - tracks: TimelineTrack[]; timelineRef: React.RefObject; - trackLabelsRef?: React.RefObject; tracksScrollRef: React.RefObject; } @@ -20,9 +17,7 @@ interface SnapIndicatorPosition { export function useSnapIndicatorPosition({ snapPoint, zoomLevel, - tracks, timelineRef, - trackLabelsRef, tracksScrollRef, }: UseSnapIndicatorPositionParams): SnapIndicatorPosition { const [scrollLeft, setScrollLeft] = useState(0); @@ -45,16 +40,11 @@ export function useSnapIndicatorPosition({ const timelineContainerHeight = timelineRef.current?.offsetHeight || 400; const totalHeight = timelineContainerHeight - 8; // 8px padding from edges - const trackLabelsWidth = - tracks.length > 0 && trackLabelsRef?.current - ? trackLabelsRef.current.offsetWidth - : 0; - const timelinePosition = timelineTimeToSnappedPixels({ time: snapPoint?.time ?? 0, zoomLevel, }); - const leftPosition = trackLabelsWidth + timelinePosition - scrollLeft; + const leftPosition = TRACK_LABELS_WIDTH_PX + timelinePosition - scrollLeft; return { leftPosition, -- cgit v1.3.1