@moxijs/ui - v0.3.5
    Preparing search index...

    Interface IFlexLayoutParticipant

    Protocol for components that participate in the flex layout system.

    Components implement this interface to:

    1. Provide their LayoutNode for tree management
    2. Measure their content size
    3. Apply computed layout to their visual representation
    class MyControl extends UIComponent implements IFlexLayoutParticipant {
    measureContent(): { width: number; height: number } {
    return { width: this.label.width, height: this.label.height };
    }

    applyLayout(computed: ComputedLayout): void {
    this.container.position.set(computed.x, computed.y);
    this.background.width = computed.width;
    this.background.height = computed.height;
    }
    }
    interface IFlexLayoutParticipant {
        id: string;
        layoutNode: LayoutNode;
        applyLayout(computed: FlexComputedLayout): void;
        measureContent(): { height: number; width: number };
        syncLayoutStyle(): void;
    }

    Implemented by

    Index

    Properties

    id: string

    Unique identifier for this participant

    layoutNode: LayoutNode

    The layout node owned by this participant. Created and managed by the participant, synced from BoxModel.

    Methods

    • Measure the content size of this component. Called during Pass 2 (measure) of the layout algorithm.

      For containers, return { width: 0, height: 0 } - children determine size. For leaf nodes, return the intrinsic content size.

      Returns { height: number; width: number }

      The measured content size in pixels

    • Sync style changes from BoxModel to LayoutNode. Called when BoxModel properties change.

      Returns void