fn apply_layout_deferred(positioner: &mut wh::DeferredWindowPositioner, stretch: &mut Stretch, nodes: Vec<Node>, children: &Vec<FlexboxLayoutChild>, last_handle: &mut Option<HWND>, offset: (i32, i32)) -> Result<(), stretch::Error> {
        use FlexboxLayoutChild as Child;

        for (node, child) in nodes.into_iter().zip(children.iter()) {
            let layout = stretch.layout(node)?;
            let Point { x, y } = layout.location;
            let Size { width, height } = layout.size;

            match child {
                Child::Item(child) => {
                    positioner.defer_pos(child.control, last_handle.unwrap_or(std::ptr::null_mut()), x as i32 + offset.0, y as i32 + offset.1, width as i32, height as i32).ok();
                    last_handle.replace(child.control);                    
                },
                Child::Flexbox(child) => {
                    let children_nodes = stretch.children(node)?;
                    FlexboxLayout::apply_layout_deferred(positioner, stretch, children_nodes, child.children().children(), last_handle, (x as i32, y as i32))?;
                }
            }
            
        }

        Ok(())
    }
// Applies the calculated item positions for this layout
// Uses deferred window positioning to prevent rendering artefacts
Applies the calculated item positions for this layout
Uses deferred window positioning to prevent rendering artefacts
Applies the calculated item positions for this layout Uses deferred window positioning to prevent rendering artefacts
fn apply_layout_deferred(positioner: &mut wh::DeferredWindowPositioner, stretch: &mut Stretch, nodes: Vec<Node>, children: &Vec<FlexboxLayoutChild>, last_handle: &mut Option<HWND>, offset: (i32, i32)) -> Result<(), stretch::Error> {
        use FlexboxLayoutChild as Child;
        for (node, child) in nodes.into_iter().zip(children.iter()) {
            let layout = stretch.layout(node)?;
            let Point { x, y } = layout.location;
            let Size { width, height } = layout.size;
            match child {
                Child::Item(child) => {
                    positioner.defer_pos(child.control, last_handle.unwrap_or(std::ptr::null_mut()), x as i32 + offset.0, y as i32 + offset.1, width as i32, height as i32).ok();
                    last_handle.replace(child.control);                    
                },
                Child::Flexbox(child) => {
                    let children_nodes = stretch.children(node)?;
                    FlexboxLayout::apply_layout_deferred(positioner, stretch, children_nodes, child.children().children(), last_handle, (x as i32, y as i32))?;
                }
            }
        }
        Ok(())
    }
fn apply_layout_deferred ( positioner : & mut wh :: DeferredWindowPositioner , stretch : & mut Stretch , nodes : Vec < Node > , children : & Vec < FlexboxLayoutChild > , last_handle : & mut Option < HWND > , offset : ( i32 , i32 ) ) -> Result < ( ) , stretch :: Error > { use FlexboxLayoutChild as Child ; for ( node , child ) in nodes . into_iter ( ) . zip ( children . iter ( ) ) { let layout = stretch . layout ( node ) ? ; let Point { x , y } = layout . location ; let Size { width , height } = layout . size ; match child { Child :: Item ( child ) => { positioner . defer_pos ( child . control , last_handle . unwrap_or ( std :: ptr :: null_mut ( ) ) , x as i32 + offset . 0 , y as i32 + offset . 1 , width as i32 , height as i32 ) . ok ( ) ; last_handle . replace ( child . control ) ; } , Child :: Flexbox ( child ) => { let children_nodes = stretch . children ( node ) ? ; FlexboxLayout :: apply_layout_deferred ( positioner , stretch , children_nodes , child . children ( ) . children ( ) , last_handle , ( x as i32 , y as i32 ) ) ? ; } } } Ok ( ( ) ) }
Applies the calculated item positions for this layout
Uses deferred window positioning to prevent rendering artefacts
Applies the calculated item positions for this layout Uses deferred window positioning to prevent rendering artefacts
positioner
&mut wh::DeferredWindowPositioner
stretch
&mut Stretch
nodes
Vec<Node>
children
&Vec<FlexboxLayoutChild>
last_handle
&mut Option<HWND>
offset
(i32, i32)