Search Results for

    Show / Hide Table of Contents

    Class TreeAlgorithm45

    This file contains the 'start a layout / relayout / detect a relayout / optimize relayout' parts.

    Inheritance
    Object
    ITreeUpdateAlgorithm
    ITreeUpdateAlgorithmV4
    ITreeUpdateAlgorithmV45plus
    TreeAlgorithm45
    Implements
    IFlexboxDescribableLayoutAlgorithm,
    Inherited Members
    ITreeUpdateAlgorithm.version
    Namespace: NinjaTools.FlexBuilder.LayoutAlgorithms
    Assembly: cs.temp.dll.dll
    Syntax
    public class TreeAlgorithm45 : ITreeUpdateAlgorithmV45plus, IFlexboxDescribableLayoutAlgorithm

    Properties

    - (String) defaultAssetName

    Used when creating new instances automatically in the Inspector or the 'auto-fix' dialog boxes

    Overrides
    ITreeUpdateAlgorithm.defaultAssetName

    - (ReadOnlyCollection<String>) featureDescription

    Overrides
    ITreeUpdateAlgorithm.featureDescription

    Methods

    - (void) ChildContentSizeChanged(FlexContainer, FlexItem)

    When something (internal or external) changes the flex 'content-size' of a FlexItem, such that the containing FlexContainer may need to do a relayout (at the very least: will nearly always need to reposition the child); most common example is user editing a Text component's string, and/or changing the anchored positions of a child UI component, or the 'size to fit' setting of a Text component, etc.

    Parameters
    FlexContainer parent
    FlexItem childChanged
    Overrides
    ITreeUpdateAlgorithmV4.ChildContentSizeChanged(FlexContainer, FlexItem)

    - (void) ChildrenChanged(FlexContainer)

    Called both because children were added/removed AND because children were enabled/disabled

    Parameters
    FlexContainer fc
    Overrides
    ITreeUpdateAlgorithmV4.ChildrenChanged(FlexContainer)

    - (void) ChildSizeAndOrPositionNeedsReinstating(FlexContainer, FlexItem)

    Parameters
    FlexContainer parent
    FlexItem childExternallyModified
    Overrides
    ITreeUpdateAlgorithmV4.ChildSizeAndOrPositionNeedsReinstating(FlexContainer, FlexItem)

    - (void) ContainerPositionNeedsReinstating(FlexContainer)

    Parameters
    FlexContainer fc
    Overrides
    ITreeUpdateAlgorithmV4.ContainerPositionNeedsReinstating(FlexContainer)

    - (void) ContainerSizeAndOrPositionNeedsReinstating(FlexContainer)

    Parameters
    FlexContainer fc
    Overrides
    ITreeUpdateAlgorithmV4.ContainerSizeAndOrPositionNeedsReinstating(FlexContainer)

    - (void) ContainerSizeAndOrPositionNeedsReinstating(RootFlexContainer)

    Parameters
    RootFlexContainer rfc
    Overrides
    ITreeUpdateAlgorithmV4.ContainerSizeAndOrPositionNeedsReinstating(RootFlexContainer)

    - (void) FlexContainerAddedOrCreated(FlexContainer, String)

    Parameters
    FlexContainer newFC
    String purpose
    Overrides
    ITreeUpdateAlgorithmV4.FlexContainerAddedOrCreated(FlexContainer, String)

    - (void) FlexItemAddedOrCreated(FlexItem, String)

    Parameters
    FlexItem newItem
    String purpose
    Overrides
    ITreeUpdateAlgorithmV4.FlexItemAddedOrCreated(FlexItem, String)

    - (void) FlexPropertyPathModified(FlexContainer, String)

    Parameters
    FlexContainer fc
    String bindingPath
    Overrides
    ITreeUpdateAlgorithmV4.FlexPropertyPathModified(FlexContainer, String)

    - (void) FlexPropertyPathModified(FlexItem, String)

    Parameters
    FlexItem fi
    String bindingPath
    Overrides
    ITreeUpdateAlgorithmV4.FlexPropertyPathModified(FlexItem, String)

    - (void) ForceRelayoutFullTree(RootFlexContainer, String)

    Parameters
    RootFlexContainer rfc
    String purpose
    Overrides
    ITreeUpdateAlgorithmV4.ForceRelayoutFullTree(RootFlexContainer, String)

    - (String) GetDebugInfo(FlexContainer)

    Parameters
    FlexContainer container
    Returns
    String
    Overrides
    ITreeUpdateAlgorithm.GetDebugInfo(FlexContainer)

    - (void) InvalidateContainerDontRelayout(FlexContainer)

    Invalidates a specific container

    Currently recurses up the tree and invalidates ALL ancestors, because this version of the layout algorithms expects that (sub-optimal, but cost is usually low)

    Parameters
    FlexContainer fc

    - (void) InvalidateItemInternals(FlexItem)

    This potentially duplicates the meaning of _CacheInvalidateMinContentSize(FlexItem) and _CacheInvalidateMaxContentSize(FlexItem) - but as of 2023 v4.0, those methods are not being actively used (MIN/MAX CONTENT_Size caching is currently not performed, because of problems with it in the 2023-beta). If those methods get re-implemented successfully, it would be sufficient to move the meat of this method into those two iff we retain this method for the cases where those two aren't invoked (they are ONLY invoked on FlexItems iff the FlexItem also is a FlexContainer).

    i.e. this method is currently the ONLY place that a "Flexitem-without-a-FlexContainer" gets to perform invalidation -- so it cannot be removed entirely, needs to be preserved (although the name could change to synch better with NinjaTools.FlexBuilder.LayoutAlgorithms.TreeAlgorithm45.Invalidate(NinjaTools.FlexBuilder.FlexContainer), perhaps).

    Invalidates a specific FlexItem - Note: this doesn't affect Flex layout, but it gives a chance to invalidate non-flexbox children (or: attached components) on FlexItems -- especially: The TMP caching that's automatically done on TMP_Text items to workaround the very slow performance of TextMeshPro in multiple cases.

    Parameters
    FlexItem item

    - (void) LayoutAlgorithmChanged(RootFlexContainer, IFlexboxLayoutAlgorithm, IFlexboxLayoutAlgorithm)

    Parameters
    RootFlexContainer rfc
    IFlexboxLayoutAlgorithm oldValue
    IFlexboxLayoutAlgorithm newValue
    Overrides
    ITreeUpdateAlgorithmV4.LayoutAlgorithmChanged(RootFlexContainer, IFlexboxLayoutAlgorithm, IFlexboxLayoutAlgorithm)

    - (void) RecursivelyInvalidateSelfAndAllAncestorsDontRelayout(FlexContainer)

    InvalidateContainerDontRelayout(FlexContainer)
    Parameters
    FlexContainer fc
    Exceptions
    Exception

    - (void) RelayoutRootContainer(RootFlexContainer, String)

    Parameters
    RootFlexContainer rfc
    String purpose
    Overrides
    ITreeUpdateAlgorithmV45plus.RelayoutRootContainer(RootFlexContainer, String)

    - (void) RootContainerAddedToCanvas(RootFlexContainer)

    Unity's UI does this badly: when a RectTransform is reparented, it FORCES itself to have the position on the old Canvas - in screen/world-space! - which is never the right decision.

    Ideally we'd maintain our anchors in new canvas/parent to (relatively) match what they were in the old parent; instead we settle for: 'resizing-to-fit before we layout'. TODO: replace the ExpandToFillParent with a 're-instate relative positions in new space'

    Parameters
    RootFlexContainer rfc
    Overrides
    ITreeUpdateAlgorithmV4.RootContainerAddedToCanvas(RootFlexContainer)

    - (void) UnfreezeContainer(FlexContainer)

    Parameters
    FlexContainer fc
    Overrides
    ITreeUpdateAlgorithmV4.UnfreezeContainer(FlexContainer)

    - (void) UnfreezeItem(FlexItem)

    Parameters
    FlexItem fi
    Overrides
    ITreeUpdateAlgorithmV4.UnfreezeItem(FlexItem)

    Implements

    IFlexboxDescribableLayoutAlgorithm,
    In This Article
    Back to top http://flexbuilder.ninja