FloatLayoutHelper
Namespace: Hex1b.Nodes
Assembly: Hex1b.dll
Shared logic for containers that support children. Handles reconciliation, arrangement, rendering, and focus traversal of floated children.
public static class FloatLayoutHelperInheritance
Object → FloatLayoutHelper
Methods
ArrangeFloats(List<FloatEntry>, Rect)
Arranges all float entries after the flow layout has completed.
Parameters:
floats(List<FloatEntry>):containerBounds(Rect):
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:
allChildren(IReadOnlyList<Hex1bWidget>):floatEntries(List<FloatEntry>):widgetToNode(Dictionary<Hex1bWidget, Hex1bNode>):
Returns: List<Hex1bNode>
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:
allChildren(IReadOnlyList<Hex1bWidget>): All children from the container widget.existingFloats(List<FloatEntry>): Previously reconciled float entries (for node reuse).context(ReconcileContext): The reconciliation context.parentNode(Hex1bNode): The parent container node.widgetToNode(Dictionary<Hex1bWidget, Hex1bNode>): Map from widget instances to reconciled nodes — populated by the caller for flow children, used here to resolve anchor references.
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.
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:
floats(List<FloatEntry>):context(Hex1bRenderContext):
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:
floats(List<FloatEntry>):parentNode(Hex1bNode):
public static void ResolveAnchors(List<FloatEntry> floats, Hex1bNode parentNode)