Expand description
Cotis trait implementations wiring CotisLayoutManager
into the standard frame and element configuration API.
§Default integration path
When using ElementConfig from
cotis-defaults, this module provides everything needed out of the box:
LayoutManagerCompatible— installs the renderer’s text measurer and viewport size.LayoutManager/LayoutFrameManager—begin_frame→CotisLayoutRun→end.ConfigureElements— open/set/close elements onCotisLayoutRun<ElementConfig<…>>.ConfigureLeafElementswithTextElementConfig— text leaf expansion.CotisLayoutCompatibleandTextConfigurablefor bothSizingandDoubleAxisSizingstyle parameterizations.From<&CotisStyle>→LayoutElementConfig— style conversion (always sets internalChildWrapping::None).
§Text layout
ConfigureLeafElements::set_leaf_config
on a text leaf expands the string into synthetic child nodes:
- Lines split on
\n, laid out top-to-bottom. - Each line becomes an LTR row with internal
ChildWrapping::Text. TextElementConfigWrapMode::Wordscreates word and spacer children withTextDrawPayload.Newline/Nonewrap modes keep one fragment per line.
Custom config types must implement CotisLayoutCompatible
and TextConfigurable to support text leaves.
§Element state queries
See secondary_traits for debugging and hit-testing hooks on the post-frame cache.
Modules§
- secondary_
traits - Element-state query trait implementations on
CotisLayoutManager.