Refactor ViewportCanvas hooks to separate document and selection updates

This commit is contained in:
2026-04-27 00:01:44 +02:00
parent d7f86b6089
commit 30a7100f8d

View File

@@ -197,12 +197,12 @@ export function ViewportCanvas({
}, [whiteboxSelectionMode]); }, [whiteboxSelectionMode]);
useLayoutEffect(() => { useLayoutEffect(() => {
hostRef.current?.updateDocument( hostRef.current?.updateSelection(selection, activeSelectionId);
sceneDocument, }, [selection, activeSelectionId]);
selection,
activeSelectionId useLayoutEffect(() => {
); hostRef.current?.updateDocument(sceneDocument);
}, [sceneDocument, selection, activeSelectionId]); }, [sceneDocument]);
useLayoutEffect(() => { useLayoutEffect(() => {
hostRef.current?.setViewMode(viewMode); hostRef.current?.setViewMode(viewMode);