public sealed class LayoutTreeAbsolutely-positioned children, which are laid out by their containing block rather than by their parent.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
They are done last, and from the containing block down rather than from the parent out, because their position is relative to a node that may be several levels above them and whose size is not known until its own layout has finished. The offset from the containing block to the parent is threaded down the walk so that the result can be written back as a parent-relative position, which is what everything else in the tree stores.
Fields and properties (2)
public int NodeCountHow many live nodes there are.
public float PointScaleFactorHow many points a device-independent pixel is, for the rounding pass. Zero disables it.
Methods (58)
public LayoutTree()Creates an empty tree.
public LayoutNodeId CreateNode()Adds a node with the CSS initial style.
public void DestroyRecursive(LayoutNodeId node)Removes a node and everything under it.
public void InsertChild(LayoutNodeId parent, LayoutNodeId child, int index)Puts under .
public void AddChild(LayoutNodeId parent, LayoutNodeId child)Appends to .
public bool RemoveChild(LayoutNodeId parent, LayoutNodeId child)Takes out of .
public int GetChildCount(LayoutNodeId node)How many children a node has.
public LayoutNodeId GetChild(LayoutNodeId node, int index)One child of a node.
public LayoutNodeId GetParent(LayoutNodeId node)A node's parent, or Invalid.
public bool IsDirty(LayoutNodeId node)Whether the node needs laying out again.
public void MarkDirty(LayoutNodeId node)Marks a node as needing layout, and its ancestors with it.
public void Invalidate(LayoutNodeId node)Marks a subtree as needing layout whatever its styles say.
public bool HasNewLayout(LayoutNodeId node)Whether this node's result changed in the last pass.
public void ClearNewLayout(LayoutNodeId node)Clears the "changed in the last pass" mark.
public void SetContext(LayoutNodeId node, object? context)Attaches arbitrary data, handed back to the measure and baseline functions.
public object? GetContext(LayoutNodeId node)Whatever was attached with SetContext.
public void SetMeasureFunction(LayoutNodeId node, MeasureFunction? measure)Makes a node measure itself instead of taking its size from its children.
public void SetBaselineFunction(LayoutNodeId node, BaselineFunction? baseline)Makes a node report its own baseline rather than taking a child's.
public void Dispose()Releases the store.
public void CalculateLayout(LayoutNodeId node, float ownerWidth, float ownerHeight, Direction ownerDirection)Lays out and everything under it.
public ref readonly LayoutStyle GetStyle(LayoutNodeId node)A node's style, for reading.
public void SetStyle(LayoutNodeId node, in LayoutStyle style)Replaces a node's whole style.
public void SetDirection(LayoutNodeId node, Direction direction)Sets the writing direction.
public void SetFlexDirection(LayoutNodeId node, FlexDirection direction)Sets the main axis.
public void SetJustifyContent(LayoutNodeId node, Justify justify)Sets main-axis distribution.
public void SetAlignContent(LayoutNodeId node, Align align)Sets cross-axis distribution of the lines.
public void SetAlignItems(LayoutNodeId node, Align align)Sets cross-axis placement of the children.
public void SetAlignSelf(LayoutNodeId node, Align align)Sets this node's own cross-axis placement.
public void SetPositionType(LayoutNodeId node, PositionType positionType)Sets how the node is positioned.
public void SetFlexWrap(LayoutNodeId node, Wrap wrap)Sets whether the line wraps.
public void SetOverflow(LayoutNodeId node, Overflow overflow)Sets what happens to content that does not fit.
public void SetDisplay(LayoutNodeId node, Display display)Sets whether the node is laid out at all.
public void SetBoxSizing(LayoutNodeId node, BoxSizing boxSizing)Sets what the dimensions measure.
public void SetFlex(LayoutNodeId node, float flex)Sets the flex shorthand.
public void SetFlexGrow(LayoutNodeId node, float flexGrow)Sets how much leftover space the node takes.
public void SetFlexShrink(LayoutNodeId node, float flexShrink)Sets how much of an overflow the node absorbs.
public void SetFlexBasis(LayoutNodeId node, StyleLength basis)Sets the main size before growing and shrinking.
public void SetAspectRatio(LayoutNodeId node, float aspectRatio)Sets the aspect ratio the node is forced into.
public void SetMargin(LayoutNodeId node, Edge edge, StyleLength margin)Sets a margin.
public void SetPosition(LayoutNodeId node, Edge edge, StyleLength position)Sets an inset.
public void SetPadding(LayoutNodeId node, Edge edge, StyleLength padding)Sets a padding.
public void SetBorder(LayoutNodeId node, Edge edge, StyleLength border)Sets a border width.
public void SetGap(LayoutNodeId node, Gutter gutter, StyleLength gap)Sets a gap.
public void SetDimension(LayoutNodeId node, Dimension dimension, StyleLength length)Sets the requested size on one axis.
public void SetMinDimension(LayoutNodeId node, Dimension dimension, StyleLength length)Sets the minimum size on one axis.
public void SetMaxDimension(LayoutNodeId node, Dimension dimension, StyleLength length)Sets the maximum size on one axis.
public float GetPosition(LayoutNodeId node, Edge edge)The resolved offset of one physical edge.
public float GetLeft(LayoutNodeId node)The laid-out left edge.
public float GetTop(LayoutNodeId node)The laid-out top edge.
public float GetRight(LayoutNodeId node)The laid-out right edge.
public float GetBottom(LayoutNodeId node)The laid-out bottom edge.
public float GetWidth(LayoutNodeId node)The laid-out width.
public float GetHeight(LayoutNodeId node)The laid-out height.
public float GetComputedMargin(LayoutNodeId node, Edge edge)The resolved margin on one physical edge.
public float GetComputedBorder(LayoutNodeId node, Edge edge)The resolved border on one physical edge.
public float GetComputedPadding(LayoutNodeId node, Edge edge)The resolved padding on one physical edge.
public Direction GetComputedDirection(LayoutNodeId node)The direction the node was laid out in.
public bool GetHadOverflow(LayoutNodeId node)Whether the node's content did not fit.
Used by (38)
- LayoutBenchmarksVixen.Benchmarks.Ui
- AbsolutePositionTestsVixen.Ui.Layout.Tests
- AlignContentTestsVixen.Ui.Layout.Tests
- AlignItemsTestsVixen.Ui.Layout.Tests
- AlignSelfTestsVixen.Ui.Layout.Tests
- AndroidNewsFeedTestsVixen.Ui.Layout.Tests
- AspectRatioTestsVixen.Ui.Layout.Tests
- AutoTestsVixen.Ui.Layout.Tests
- AutomaticMinimumSizeTestsVixen.Ui.Layout.Tests
- BorderTestsVixen.Ui.Layout.Tests
- BoxSizingTestsVixen.Ui.Layout.Tests
- ConformanceMeasureVixen.Ui.Layout.Tests
- DimensionTestsVixen.Ui.Layout.Tests
- DisplayTestsVixen.Ui.Layout.Tests
- DrawListBuilderVixen.Ui
- FlexBasisFitContentTestsVixen.Ui.Layout.Tests
- FlexDirectionTestsVixen.Ui.Layout.Tests
- FlexTestsVixen.Ui.Layout.Tests
- FlexWrapTestsVixen.Ui.Layout.Tests
- GapTestsVixen.Ui.Layout.Tests
- IntrinsicSizeTestsVixen.Ui.Layout.Tests
- JustifyContentTestsVixen.Ui.Layout.Tests
- LayoutPassTestsVixen.Ui.Layout.Tests
- LayoutTreeTestsVixen.Ui.Layout.Tests
- MarginTestsVixen.Ui.Layout.Tests
- MeasureRequestVixen.Ui.Layout
- MinMaxDimensionTestsVixen.Ui.Layout.Tests
- PaddingTestsVixen.Ui.Layout.Tests
- PanelSpecVixen.Ui.Layout.Tests
- PercentageTestsVixen.Ui.Layout.Tests
- PixelRoundingTestsVixen.Ui.Layout.Tests
- RemovalTestsVixen.Ui.Tests
- RoundingTestsVixen.Ui.Layout.Tests
- ScopedStyleTestsVixen.Ui.Tests
- SizeOverflowTestsVixen.Ui.Layout.Tests
- StaticPositionTestsVixen.Ui.Layout.Tests
- UiDocumentVixen.Ui
- UiElementVixen.Ui