Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
EditorShellLayout.h File Reference
#include <optional>
Include dependency graph for EditorShellLayout.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::editor::EditorAdaptiveUiInput
 Inputs used to select and size the adaptive editor chrome. More...
struct  donner::editor::EditorAdaptiveUiLayout
 Adaptive editor chrome geometry and feature subset for one frame. More...
struct  donner::editor::EditorMainPaneLayoutInput
 Inputs used to compute the editor's horizontal source/render/sidebar layout. More...
struct  donner::editor::EditorMainPaneLayout
 Computed geometry for the editor's horizontal source/render/sidebar layout. More...
struct  donner::editor::RightSidebarLayoutInput
 Inputs used to compute the editor's right sidebar pane layout. More...
struct  donner::editor::RightSidebarLayout
 Computed geometry for the editor's right sidebar panes. More...
struct  donner::editor::LayoutRect
 A screen-space rectangle in logical pixels. More...
struct  donner::editor::RenderPaneLatchInput
 Geometry the render pane's first-fit latch inspects to decide whether this frame's pane rectangle is the settled one. See RenderPaneViewportLatchReady. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Enumerations

enum class  donner::editor::EditorUiMode {
  Desktop ,
  CompactTouch
}
 Editor chrome profile selected from viewport constraints and input type. More...
enum class  donner::editor::CompactPanelPlacement {
  Right ,
  Bottom
}
 Edge used for the compact Layers or Inspector sheet. More...

Functions

EditorAdaptiveUiLayout donner::editor::ComputeEditorAdaptiveUiLayout (const EditorAdaptiveUiInput &input)
 Select and size the editor's desktop or compact-touch chrome.
EditorMainPaneLayout donner::editor::ComputeEditorMainPaneLayout (const EditorMainPaneLayoutInput &input)
 Compute horizontal pane geometry for the source pane, render pane, and right sidebar.
float donner::editor::AdvanceSourcePaneRevealProgress (float currentProgress, bool targetVisible, float deltaSeconds)
 Advance the source-pane reveal toward its target at the fixed UI animation rate.
RightSidebarLayout donner::editor::ComputeRightSidebarLayout (const RightSidebarLayoutInput &input)
 Compute right sidebar pane geometry for a fixed tree view and resizable inspector/layer split.
float donner::editor::ResizeLayerPanelHeightFraction (float currentFraction, float lowerPaneHeight, float minLayerPanelHeight, float maxLayerPanelHeight, float splitterDeltaY)
 Update the layer panel height fraction from a vertical splitter drag.
bool donner::editor::RenderPaneViewportLatchReady (const RenderPaneLatchInput &input)
 Decide whether the render pane's rectangle may be latched as the document's initial fit.

Enumeration Type Documentation

◆ CompactPanelPlacement

Edge used for the compact Layers or Inspector sheet.

Enumerator
Right 

Landscape viewport: panel overlays the right edge.

Bottom 

Portrait or square viewport: panel overlays the bottom edge.

◆ EditorUiMode

enum class donner::editor::EditorUiMode
strong

Editor chrome profile selected from viewport constraints and input type.

Enumerator
Desktop 

Persistent desktop menus, source access, and docked panels.

CompactTouch 

Canvas-first chrome with touch-sized controls and one panel sheet.

Function Documentation

◆ AdvanceSourcePaneRevealProgress()

float donner::editor::AdvanceSourcePaneRevealProgress ( float currentProgress,
bool targetVisible,
float deltaSeconds )
nodiscard

Advance the source-pane reveal toward its target at the fixed UI animation rate.

Parameters
currentProgressCurrent linear progress in [0, 1].
targetVisibleTrue to advance toward fully visible.
deltaSecondsElapsed frame time in seconds.
Returns
Updated linear progress in [0, 1].

◆ ComputeEditorAdaptiveUiLayout()

EditorAdaptiveUiLayout donner::editor::ComputeEditorAdaptiveUiLayout ( const EditorAdaptiveUiInput & input)
nodiscard

Select and size the editor's desktop or compact-touch chrome.

Constrained native windows use the compact profile even before a touch event. Touch-preferred platforms use it at every size so controls never shrink after the first gesture.

Parameters
inputWindow geometry and input preference.

◆ ComputeEditorMainPaneLayout()

EditorMainPaneLayout donner::editor::ComputeEditorMainPaneLayout ( const EditorMainPaneLayoutInput & input)
nodiscard

Compute horizontal pane geometry for the source pane, render pane, and right sidebar.

Parameters
inputHorizontal layout constraints and persisted sidebar width.

◆ ComputeRightSidebarLayout()

RightSidebarLayout donner::editor::ComputeRightSidebarLayout ( const RightSidebarLayoutInput & input)
nodiscard

Compute right sidebar pane geometry for a fixed tree view and resizable inspector/layer split.

Parameters
inputSidebar layout constraints and persisted layer split fraction.

◆ RenderPaneViewportLatchReady()

bool donner::editor::RenderPaneViewportLatchReady ( const RenderPaneLatchInput & input)
nodiscard

Decide whether the render pane's rectangle may be latched as the document's initial fit.

The canvas is docked into the DockSpace central node, so ImGui owns the pane rectangle and reports transient values while a layout change propagates. Fitting the document to a transient rectangle and rendering against it presents the document at the wrong fit (the placeholder viewport) and then jumps once the pane settles, so the latch must reject every pre-settle rectangle regardless of how many frames the transient survives.

The policy is two-sided and grounded in geometry the shell computes itself:

  1. The dock host rect, a pure function of the window size and the shell's own pane state, must be unchanged from the previous frame. Nothing downstream of a moving host is settled, and no inspection of ImGui's own state can tell a moving host from a stationary one.
  2. ImGui must have propagated this frame's central-node rect into the docked pane window, i.e. the pane window rect equals the central node rect. A stale pane window fails this whether it is larger or smaller than the node.
  3. The central node must be the host's column split: same origin, full host height, and never wider than the host. These are exact comparisons against the shell's own host rect, so a node that is short or offset because some upstream geometry has not settled is rejected.
  4. When the layout carries a sidebar column, that column must already be split off (the node is strictly narrower than the host); in the compact profile the node instead spans the host.

A dock tree this policy cannot recognize, a customized layout restored from the persisted .ini say, falls back to the pre-existing rule: the same content region on two consecutive frames, still gated on a stationary host.

Parameters
inputThis frame's pane, central-node, and host geometry plus the previous frame's.

◆ ResizeLayerPanelHeightFraction()

float donner::editor::ResizeLayerPanelHeightFraction ( float currentFraction,
float lowerPaneHeight,
float minLayerPanelHeight,
float maxLayerPanelHeight,
float splitterDeltaY )
nodiscard

Update the layer panel height fraction from a vertical splitter drag.

Parameters
currentFractionCurrent fraction of lowerPaneHeight assigned to the layer panel.
lowerPaneHeightHeight available to the inspector and layer panel.
minLayerPanelHeightMinimum allowed layer panel height.
maxLayerPanelHeightMaximum allowed layer panel height.
splitterDeltaYImGui mouse delta for the splitter; dragging down shrinks the layer panel.