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