From 1a01871cfc7a6405ed1140c7ed415e170843e40d Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Tue, 1 Jul 2025 01:13:14 +0200 Subject: refactor: update media processing to use width and height instead of aspect ratio --- apps/web/src/stores/timeline-store.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'apps/web/src/stores/timeline-store.ts') diff --git a/apps/web/src/stores/timeline-store.ts b/apps/web/src/stores/timeline-store.ts index 9f98b320..01f4fea6 100644 --- a/apps/web/src/stores/timeline-store.ts +++ b/apps/web/src/stores/timeline-store.ts @@ -1,8 +1,7 @@ import { create } from "zustand"; import type { TrackType } from "@/types/timeline"; import { useEditorStore } from "./editor-store"; -import { useMediaStore } from "./media-store"; -import { toast } from "sonner"; +import { useMediaStore, getMediaAspectRatio } from "./media-store"; // Helper function to manage clip naming with suffixes const getClipNameWithSuffix = ( @@ -232,7 +231,9 @@ export const useTimelineStore = create((set, get) => ({ (mediaItem.type === "image" || mediaItem.type === "video") ) { const editorStore = useEditorStore.getState(); - editorStore.setCanvasSizeFromAspectRatio(mediaItem.aspectRatio); + editorStore.setCanvasSizeFromAspectRatio( + getMediaAspectRatio(mediaItem) + ); } } -- cgit v1.3.1