Skip to content

FloatLayoutHelper ​

Namespace: Hex1b.Nodes

Assembly: Hex1b.dll

Shared logic for containers that support children. Handles reconciliation, arrangement, rendering, and focus traversal of floated children.

csharp
public static class FloatLayoutHelper

Inheritance ​

Object → FloatLayoutHelper

Methods ​

ArrangeFloats(List<FloatEntry>, Rect) ​

Arranges all float entries after the flow layout has completed.

Parameters:

csharp
public static void ArrangeFloats(List<FloatEntry> floats, Rect containerBounds)

BuildDeclarationOrder(IReadOnlyList<Hex1bWidget>, List<FloatEntry>, Dictionary<Hex1bWidget, Hex1bNode>) ​

Builds a declaration-order list of all children (flow + float) for focus traversal. Must be called AFTER flow children have been reconciled and added to widgetToNode.

Parameters:

Returns: List<Hex1bNode>

csharp
public static List<Hex1bNode> BuildDeclarationOrder(IReadOnlyList<Hex1bWidget> allChildren, List<FloatEntry> floatEntries, Dictionary<Hex1bWidget, Hex1bNode> widgetToNode)

ReconcileFloatsAsync(IReadOnlyList<Hex1bWidget>, List<FloatEntry>, ReconcileContext, Hex1bNode, Dictionary<Hex1bWidget, Hex1bNode>) ​

Separates children into flow and float widgets, reconciles float children, and stores anchor widget references for later resolution.

Parameters:

Returns: Task<Hex1bWidget>, FloatEntry>>>

A tuple of (flowChildren, floatEntries) where float entries have unresolved anchors. Call after flow children are reconciled to resolve anchor references.

csharp
public static Task<(List<Hex1bWidget> FlowChildren, List<FloatEntry> Floats)> ReconcileFloatsAsync(IReadOnlyList<Hex1bWidget> allChildren, List<FloatEntry> existingFloats, ReconcileContext context, Hex1bNode parentNode, Dictionary<Hex1bWidget, Hex1bNode> widgetToNode)

RenderFloats(List<FloatEntry>, Hex1bRenderContext) ​

Renders float entries (called after rendering flow children).

Parameters:

csharp
public static void RenderFloats(List<FloatEntry> floats, Hex1bRenderContext context)

ResolveAnchors(List<FloatEntry>, Hex1bNode) ​

Resolves anchor widget references to their reconciled nodes. Must be called AFTER flow children have been reconciled. Searches the node tree recursively so anchors can reference nested widgets (e.g., a Border inside a Center/Padding wrapper).

Parameters:

csharp
public static void ResolveAnchors(List<FloatEntry> floats, Hex1bNode parentNode)

Released under the MIT License.