Class ILayoutAlgorithmV4x1
Extends the basic contract of all ILayoutAlgorithmV4 algorithms by adding a large number
of optimizations, extra features, etc that apply to Algorithms numbered v4.1.x - but which are likely to be
replaced or superceded by later algorithms in the v4.x line
Inheritance
ILayoutAlgorithmV4x1
Assembly: cs.temp.dll.dll
public abstract class ILayoutAlgorithmV4x1 : ILayoutAlgorithmV4, IFlexboxDescribableLayoutAlgorithm
Fields
- (IContentSizeCalculator4x1)
calculatorForContentSizes
Methods
- (void)
_CacheInvalidateMaxContentSize(FlexItem)
- (void)
_CacheInvalidateMinContentSize(FlexItem)
NOTE: requires that all children have ALREADY been sized (RectTransform sizes) set to correct values BEFORE
this is invoked (it reads-back their RectTransform sizes to decide how/where to position them)
Parameters
Flexbox Spec is poorly written here - it obscures the fact that 'inline axis' means something magical from
outside the Spec (it is ONLY defined relative to Text contents - NOTHING else!)
Parameters
Returns
- (Vector2)
CalculateContentSizeFromPhase1Results(FlexContainer, List, Axis, Boolean)
NOTE: this has to include the line-wrapping logic in order to correctly calculate the true main/cross sizes
Parameters
Returns
Calculates all the data that is needed to perform visual layout - this is where 99% of each algorithm's work
happens -- after this call, you know the SIZE of every child-item, and you know how they are ARRANGED (in lines),
but external caller must then APPLY those sizes and POSITION those children using this data.
Phase 1:
Calculate sizes of all children, and assign them into lines (just one line if wrapping is disabled), ready to be positioned
NOTE: the CSSAvailableSpace argument isn't used for normal layout, it's only used when doing recursive layout
(i.e. "container inside another container") in situations where there is no knowable 'size' for the child
container, and so this enables it to fallback on using 'all the space that was available within my parent
container' as its default available space WITHOUT corrupting its own size, which is still unknown at this point)
NOTE: the "finalSizes" here do NOT include margins; they are the CSS 'border box' sizes, i.e. ready to be
applied as Unity.UI 'rectTransform sizes'.
Parameters
FlexContainer |
container |
Container to process: the child items within this container will be sized
|
CSSContainerSize |
containersNewSize |
The already-calculated size of the container (often one of the dimensions is indefinite, MAX-CONTENT)
|
CSSAvailableSpace |
whenSizeUnknown_parentsAvailableSpace |
Null when doing direct layout, or 'parent's space pre-allocated for this child container' when a parent container triggers this call to force a child-container to calculate its own content-size
|
Returns
NB: requires/assumes that the container's own .rectTransform.size has already been updated, or was already correct
and is not being changed - it uses this info to precisely position everything within the container, and take account
of both absolute and percentage offsets, padding, etc.
Parameters
Exceptions
Implements