diff --git a/src/components/studio/CanvasEditor.tsx b/src/components/studio/CanvasEditor.tsx index e53712d..88bf792 100644 --- a/src/components/studio/CanvasEditor.tsx +++ b/src/components/studio/CanvasEditor.tsx @@ -14,7 +14,7 @@ import { resetNodeScale, } from "@/lib/canvas-transform"; import { getShapeProps } from "@/lib/studio-layer-props"; -import { getActiveScene, useStudioStore } from "@/lib/studio-store"; +import { getActiveScene, isFlexStoryProject, useStudioStore } from "@/lib/studio-store"; import type { Layer as StudioLayer } from "@/lib/studio-types"; export const STAGE_WIDTH = 1280; @@ -36,6 +36,12 @@ export function CanvasEditor() { const setSelectedLayer = useStudioStore((state) => state.setSelectedLayer); const updateLayer = useStudioStore((state) => state.updateLayer); const updateScene = useStudioStore((state) => state.updateScene); + // Scene-engine (FlexStory) templates render in Remotion at fixed positions — + // dragging/resizing layers on the canvas does nothing, so the canvas becomes a + // read-only preview; editing happens only via the field form. + const lockedGeometry = useStudioStore((state) => + isFlexStoryProject(state.chooseMode) + ); const thumbTimerRef = useRef | null>(null); @@ -90,9 +96,11 @@ export function CanvasEditor() { } }, [selectedLayerId, sortedLayers, isPlaying]); - // Auto-capture scene thumbnail whenever layers or background change + // Auto-capture scene thumbnail whenever layers or background change. Skipped for + // scene-engine templates so the flat Konva snapshot doesn't overwrite the real + // rendered per-scene image. useEffect(() => { - if (isPlaying || !activeSceneId) return; + if (isPlaying || !activeSceneId || lockedGeometry) return; if (thumbTimerRef.current) clearTimeout(thumbTimerRef.current); thumbTimerRef.current = setTimeout(() => { @@ -182,9 +190,9 @@ export function CanvasEditor() { height={stageHeight} scaleX={scale} scaleY={scale} - onMouseDown={isPlaying ? undefined : handleStagePointerDown} + onMouseDown={isPlaying || lockedGeometry ? undefined : handleStagePointerDown} > - + ))} - {!isPlaying ? ( + {!isPlaying && !lockedGeometry ? (