refactor: move canvas size to be a project-level setting instead of editor-level

This commit is contained in:
Maze Winther
2025-08-04 20:45:48 +02:00
parent f0dd30ebfc
commit b0329f1372
7 changed files with 163 additions and 117 deletions
@@ -57,14 +57,18 @@ function ProjectSettingsTabs() {
}
function ProjectInfoView() {
const { activeProject, updateProjectFps } = useProjectStore();
const { canvasPresets, setCanvasSize } = useEditorStore();
const { activeProject, updateProjectFps, updateCanvasSize } =
useProjectStore();
const { canvasPresets } = useEditorStore();
const { getDisplayName } = useAspectRatio();
const handleAspectRatioChange = (value: string) => {
const preset = canvasPresets.find((p) => p.name === value);
if (preset) {
setCanvasSize({ width: preset.width, height: preset.height });
updateCanvasSize(
{ width: preset.width, height: preset.height },
"preset"
);
}
};