nativeview-layout 0.1.0-rc.1

Shared NodeStore layout layer: StoreLayoutEngine / TextMeasurer traits and the default direct Taffy engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! `display_env!`: this engine's committed [`crate::DisplayEnv`] (`@media` env, committed
//! `@container` envs, live pseudo-state). A macro so the borrow checker sees disjoint field
//! borrows next to `&mut self.top_layer` / `&mut self.box_children`.

macro_rules! display_env {
    ($layout:expr, $interaction:expr) => {
        crate::DisplayEnv {
            media: ($layout.responsive_node_count > 0).then_some(&$layout.media_env),
            container_envs: ($layout.container_node_count > 0)
                .then_some(&$layout.resolved_container_env),
            interaction: $interaction,
        }
    };
}