summaryrefslogtreecommitdiff
path: root/apps/web/src/hooks/use-timeline-zoom-actions.ts
diff options
context:
space:
mode:
authorleimingsheng <leimingsheng@58.com>2025-07-21 19:51:11 +0800
committerleimingsheng <leimingsheng@58.com>2025-07-21 19:51:11 +0800
commit3c76a3f241c8d0d00f9aa635bb14728e61296c58 (patch)
treebbeb71239a6ffa553ebd342927787ddd7c258594 /apps/web/src/hooks/use-timeline-zoom-actions.ts
parent768a1dbfbc629f3817cc872d02ca080ab7a091ec (diff)
downloadopencut-3c76a3f241c8d0d00f9aa635bb14728e61296c58.tar.gz
feat: fix some error
Diffstat (limited to 'apps/web/src/hooks/use-timeline-zoom-actions.ts')
-rw-r--r--apps/web/src/hooks/use-timeline-zoom-actions.ts5
1 files changed, 3 insertions, 2 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