Add activeSelectionId to ViewportCanvas props and update effects
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user