package toffee
Build not yet checkedInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=a92cbbcbe016fb19fb0a749222da0e459a9567aef3f4c7340d9bd6b71c53ed6f
sha512=6a7ab054605538bb31a2b73a1a6d093981a2704c9f0af5852221c05735290d74aca7c7282298c4d0f91e86a800e2ccd94b4918af883cd963449c758eb6b272b3
doc/toffee.tree/Toffee_tree/Run_mode/index.html
Module Toffee_tree.Run_modeSource
Layout computation mode.
Run mode determines how layout algorithms execute: computing full layouts for all nodes, computing only container sizes, or handling hidden nodes. This affects which layout steps are performed and whether child layouts are computed.
Performance
Compute_size enables early exits in layout algorithms when only the container's dimensions are needed. Layout implementations check run mode and return immediately once container size is determined, skipping child positioning and final layout steps. This optimization is critical for intrinsic size queries (e.g., computing min-content or max-content widths) where only dimensions matter, not child positions.
type t = | Perform_layout(*Compute full layout for this node and all children.
All layout steps are performed, including child layout computation, positioning, and size determination. This is the standard mode for visible nodes requiring complete layout information.
*)| Compute_size(*Compute only the container size for this node.
Layout steps unnecessary for determining the node's container size may be skipped. This mode optimizes layout computation when only the node's dimensions are needed, not the full layout tree.
*)
to_string mode returns the string representation of mode.
Returns "PerformLayout", "ComputeSize", or "PerformHiddenLayout".
compare a b compares run modes a and b.
Ordering: Perform_layout < Compute_size < Perform_hidden_layout.
pp fmt mode prints mode to formatter fmt using to_string.