Add activeSelectionId to ViewportCanvas props and update effects

This commit is contained in:
2026-04-15 14:56:58 +02:00
parent a7f1183382
commit 2a5800eb08

View File

@@ -51,6 +51,7 @@ interface ViewportCanvasProps {
whiteboxSnapStep: number; whiteboxSnapStep: number;
viewportGridVisible: boolean; viewportGridVisible: boolean;
selection: EditorSelection; selection: EditorSelection;
activeSelectionId: string | null;
toolMode: ToolMode; toolMode: ToolMode;
toolPreview: ViewportToolPreview; toolPreview: ViewportToolPreview;
transformSession: TransformSessionState; transformSession: TransformSessionState;
@@ -84,6 +85,7 @@ export function ViewportCanvas({
whiteboxSnapStep, whiteboxSnapStep,
viewportGridVisible, viewportGridVisible,
selection, selection,
activeSelectionId,
toolMode, toolMode,
toolPreview, toolPreview,
transformSession, transformSession,
@@ -184,8 +186,12 @@ export function ViewportCanvas({
}, [whiteboxSelectionMode]); }, [whiteboxSelectionMode]);
useLayoutEffect(() => { useLayoutEffect(() => {
hostRef.current?.updateDocument(sceneDocument, selection); hostRef.current?.updateDocument(
}, [sceneDocument, selection]); sceneDocument,
selection,
activeSelectionId
);
}, [sceneDocument, selection, activeSelectionId]);
useLayoutEffect(() => { useLayoutEffect(() => {
hostRef.current?.setViewMode(viewMode); hostRef.current?.setViewMode(viewMode);