From 3c76a3f241c8d0d00f9aa635bb14728e61296c58 Mon Sep 17 00:00:00 2001 From: leimingsheng Date: Mon, 21 Jul 2025 19:51:11 +0800 Subject: feat: fix some error --- apps/web/src/stores/timeline-store.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'apps/web/src/stores') diff --git a/apps/web/src/stores/timeline-store.ts b/apps/web/src/stores/timeline-store.ts index 89a81942..f21a4d57 100644 --- a/apps/web/src/stores/timeline-store.ts +++ b/apps/web/src/stores/timeline-store.ts @@ -1169,12 +1169,13 @@ export const useTimelineStore = create((set, get) => { if (totalDuration === 0) return 1; // Leave some padding (10% on each side) - const availableWidth = containerWidth * 0.8; + const CONTAINER_PADDING_FACTOR = 0.8; + const availableWidth = containerWidth * CONTAINER_PADDING_FACTOR; const requiredWidth = totalDuration * TIMELINE_CONSTANTS.PIXELS_PER_SECOND; const calculatedZoom = availableWidth / requiredWidth; - // Clamp between min and max zoom levels (0.3 to 5) - return Math.max(0.5, Math.min(5, calculatedZoom)); + // Clamp between min and max zoom levels + return Math.max(TIMELINE_CONSTANTS.MIN_ZOOM, Math.min(TIMELINE_CONSTANTS.MAX_ZOOM, calculatedZoom)); }, redo: () => { -- cgit v1.3.1