summaryrefslogtreecommitdiff
path: root/apps/web/src/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/src/hooks')
-rw-r--r--apps/web/src/hooks/use-timeline-zoom-actions.ts5
-rw-r--r--apps/web/src/hooks/use-timeline-zoom.ts2
2 files changed, 4 insertions, 3 deletions
diff --git a/apps/web/src/hooks/use-timeline-zoom-actions.ts b/apps/web/src/hooks/use-timeline-zoom-actions.ts
index 85003684..c6f9c50c 100644
--- a/apps/web/src/hooks/use-timeline-zoom-actions.ts
+++ b/apps/web/src/hooks/use-timeline-zoom-actions.ts
@@ -1,6 +1,7 @@
"use client";
import { useActionHandler } from "@/constants/actions";
+import { MIN_ZOOM, MAX_ZOOM /*, ZOOM_STEP */ } from "../constants/timeline-constants";
interface UseTimelineZoomActionsProps {
zoomLevel: number;
@@ -15,12 +16,12 @@ export function useTimelineZoomActions({
}: UseTimelineZoomActionsProps) {
// Zoom in action
useActionHandler("zoom-in", () => {
- setZoomLevel((prev) => Math.min(5, prev + 0.2));
+ setZoomLevel((prev) => Math.min(MAX_ZOOM, prev + /*ZOOM_STEP*/ 0.2));
});
// Zoom out action
useActionHandler("zoom-out", () => {
- setZoomLevel((prev) => Math.max(0.1, prev - 0.2));
+ setZoomLevel((prev) => Math.max(MIN_ZOOM, prev - /*ZOOM_STEP*/ 0.2));
});
// Reset zoom action
diff --git a/apps/web/src/hooks/use-timeline-zoom.ts b/apps/web/src/hooks/use-timeline-zoom.ts
index eca9d44d..1031e4a0 100644
--- a/apps/web/src/hooks/use-timeline-zoom.ts
+++ b/apps/web/src/hooks/use-timeline-zoom.ts
@@ -87,7 +87,7 @@ export function useTimelineZoom({
document.addEventListener('keydown', handleKeyDown);
return () => document.removeEventListener('keydown', handleKeyDown);
}
- }, [isInTimeline, setZoomLevel]);
+ }, [isInTimeline, setZoomLevel, onFitToWindow]);
// Prevent browser zooming in/out when in timeline
useEffect(() => {