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 --- .../editor/panels/assets/views/settings.tsx | 168 --------------------- 1 file changed, 168 deletions(-) delete mode 100644 apps/web/src/components/editor/panels/assets/views/settings.tsx (limited to 'apps/web/src/components/editor/panels/assets/views/settings.tsx') diff --git a/apps/web/src/components/editor/panels/assets/views/settings.tsx b/apps/web/src/components/editor/panels/assets/views/settings.tsx deleted file mode 100644 index d46e9d1f..00000000 --- a/apps/web/src/components/editor/panels/assets/views/settings.tsx +++ /dev/null @@ -1,168 +0,0 @@ -"use client"; - -import { PanelView } from "@/components/editor/panels/assets/views/base-view"; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/components/ui/select"; -import { FPS_PRESETS } from "@/constants/project-constants"; -import { useEditor } from "@/hooks/use-editor"; -import { useEditorStore } from "@/stores/editor-store"; -import { dimensionToAspectRatio } from "@/utils/geometry"; -import { - Section, - SectionContent, - SectionHeader, - SectionTitle, -} from "@/components/editor/panels/properties/section"; -import { Label } from "@/components/ui/label"; -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/components/ui/popover"; - -const ORIGINAL_PRESET_VALUE = "original"; - -export function findPresetIndexByAspectRatio({ - presets, - targetAspectRatio, -}: { - presets: Array<{ width: number; height: number }>; - targetAspectRatio: string; -}) { - for (let index = 0; index < presets.length; index++) { - const preset = presets[index]; - const presetAspectRatio = dimensionToAspectRatio({ - width: preset.width, - height: preset.height, - }); - if (presetAspectRatio === targetAspectRatio) { - return index; - } - } - return -1; -} - -export function SettingsView() { - return ( - -
-
- - - -
- -
- -
- } - > - Background - -
-
-
- -
- - -
- - ); -} - -function ProjectInfoContent() { - const editor = useEditor(); - const activeProject = editor.project.getActive(); - const { canvasPresets } = useEditorStore(); - - const currentCanvasSize = activeProject.settings.canvasSize; - const currentAspectRatio = dimensionToAspectRatio(currentCanvasSize); - const originalCanvasSize = activeProject.settings.originalCanvasSize ?? null; - const presetIndex = findPresetIndexByAspectRatio({ - presets: canvasPresets, - targetAspectRatio: currentAspectRatio, - }); - const selectedPresetValue = - presetIndex !== -1 ? presetIndex.toString() : ORIGINAL_PRESET_VALUE; - - const handleAspectRatioChange = ({ value }: { value: string }) => { - if (value === ORIGINAL_PRESET_VALUE) { - const canvasSize = originalCanvasSize ?? currentCanvasSize; - editor.project.updateSettings({ - settings: { canvasSize }, - }); - return; - } - const index = parseInt(value, 10); - const preset = canvasPresets[index]; - if (preset) { - editor.project.updateSettings({ settings: { canvasSize: preset } }); - } - }; - - const handleFpsChange = ({ value }: { value: string }) => { - const fps = parseFloat(value); - editor.project.updateSettings({ settings: { fps } }); - }; - - return ( -
-
- - - {activeProject.metadata.name} - -
-
- - -
-
- - -
-
- ); -} -- cgit v1.3.1