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]);
useLayoutEffect(() => {
hostRef.current?.updateDocument(
sceneDocument,
selection,
activeSelectionId
);
}, [sceneDocument, selection, activeSelectionId]);
hostRef.current?.updateSelection(selection, activeSelectionId);
}, [selection, activeSelectionId]);
useLayoutEffect(() => {
hostRef.current?.updateDocument(sceneDocument);
}, [sceneDocument]);
useLayoutEffect(() => {
hostRef.current?.setViewMode(viewMode);