From 5a44efe53364b899b6d86335f901b6522ddf32dc Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 2 Apr 2026 22:32:33 +0200 Subject: [PATCH] Add createDefaultViewportLayoutState function in viewport-layout.ts --- src/viewport-three/viewport-layout.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/viewport-three/viewport-layout.ts b/src/viewport-three/viewport-layout.ts index 6b3199ae..4abeba15 100644 --- a/src/viewport-three/viewport-layout.ts +++ b/src/viewport-three/viewport-layout.ts @@ -44,6 +44,27 @@ export const DEFAULT_VIEWPORT_LAYOUT_STATE: ViewportLayoutState = { } }; +export function createDefaultViewportLayoutState(): ViewportLayoutState { + return { + layoutMode: DEFAULT_VIEWPORT_LAYOUT_STATE.layoutMode, + activePanelId: DEFAULT_VIEWPORT_LAYOUT_STATE.activePanelId, + panels: { + topLeft: { + ...DEFAULT_VIEWPORT_LAYOUT_STATE.panels.topLeft + }, + topRight: { + ...DEFAULT_VIEWPORT_LAYOUT_STATE.panels.topRight + }, + bottomLeft: { + ...DEFAULT_VIEWPORT_LAYOUT_STATE.panels.bottomLeft + }, + bottomRight: { + ...DEFAULT_VIEWPORT_LAYOUT_STATE.panels.bottomRight + } + } + }; +} + const VIEWPORT_PANEL_LABELS: Record = { topLeft: "Top Left", topRight: "Top Right", @@ -72,4 +93,3 @@ export function getViewportLayoutModeLabel(layoutMode: ViewportLayoutMode): stri export function getViewportDisplayModeLabel(displayMode: ViewportDisplayMode): string { return VIEWPORT_DISPLAY_MODE_LABELS[displayMode]; } -