Update component props and styles for App and ViewportCanvas

This commit is contained in:
2026-03-31 02:05:57 +02:00
parent d78da160a0
commit b676dc2e1f
4 changed files with 62 additions and 5 deletions

View File

@@ -7,12 +7,12 @@ import { ViewportHost } from "./viewport-host";
interface ViewportCanvasProps {
world: WorldSettings;
document: SceneDocument;
sceneDocument: SceneDocument;
selection: EditorSelection;
onBrushSelectionChange(brushId: string | null): void;
}
export function ViewportCanvas({ world, document, selection, onBrushSelectionChange }: ViewportCanvasProps) {
export function ViewportCanvas({ world, sceneDocument, selection, onBrushSelectionChange }: ViewportCanvasProps) {
const containerRef = useRef<HTMLDivElement | null>(null);
const hostRef = useRef<ViewportHost | null>(null);
const [viewportMessage, setViewportMessage] = useState<string | null>(null);
@@ -57,8 +57,8 @@ export function ViewportCanvas({ world, document, selection, onBrushSelectionCha
}, [world]);
useEffect(() => {
hostRef.current?.updateDocument(document, selection);
}, [document, selection]);
hostRef.current?.updateDocument(sceneDocument, selection);
}, [sceneDocument, selection]);
useEffect(() => {
hostRef.current?.setBrushSelectionChangeHandler(onBrushSelectionChange);

View File

@@ -5,6 +5,7 @@ import {
Color,
DirectionalLight,
EdgesGeometry,
GridHelper,
Group,
LineBasicMaterial,
LineSegments,