fn apply_layout_immediate(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) => unsafe {
                    wh::set_window_position(child.control, x as i32 + offset.0, y as i32 + offset.1);
                    wh::set_window_size(child.control, width as u32, height as u32, false);
                    wh::set_window_after(child.control, *last_handle);
                    last_handle.replace(child.control);                    
                },
                Child::Flexbox(child) => {
                    let children_nodes = stretch.children(node)?;
                    FlexboxLayout::apply_layout_immediate(stretch, children_nodes, child.children().children(), last_handle, (x as i32, y as i32))?;
                }
            }
            
        }

        Ok(())
    }
// Applies the calculated item positions for this layout
// Uses immediate window positioning, which might cause visual artefacts in some cases
Applies the calculated item positions for this layout
Uses immediate window positioning, which might cause visual artefacts in some cases
Applies the calculated item positions for this layout Uses immediate window positioning which might cause visual artefacts in some cases
fn apply_layout_immediate(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) => unsafe {
                    wh::set_window_position(child.control, x as i32 + offset.0, y as i32 + offset.1);
                    wh::set_window_size(child.control, width as u32, height as u32, false);
                    wh::set_window_after(child.control, *last_handle);
                    last_handle.replace(child.control);                    
                },
                Child::Flexbox(child) => {
                    let children_nodes = stretch.children(node)?;
                    FlexboxLayout::apply_layout_immediate(stretch, children_nodes, child.children().children(), last_handle, (x as i32, y as i32))?;
                }
            }
        }
        Ok(())
    }
fn apply_layout_immediate ( 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 ) => unsafe { wh :: set_window_position ( child . control , x as i32 + offset . 0 , y as i32 + offset . 1 ) ; wh :: set_window_size ( child . control , width as u32 , height as u32 , false ) ; wh :: set_window_after ( child . control , * last_handle ) ; last_handle . replace ( child . control ) ; } , Child :: Flexbox ( child ) => { let children_nodes = stretch . children ( node ) ? ; FlexboxLayout :: apply_layout_immediate ( stretch , children_nodes , child . children ( ) . children ( ) , last_handle , ( x as i32 , y as i32 ) ) ? ; } } } Ok ( ( ) ) }
Applies the calculated item positions for this layout
Uses immediate window positioning, which might cause visual artefacts in some cases
Applies the calculated item positions for this layout Uses immediate window positioning which might cause visual artefacts in some cases
stretch
&mut Stretch
nodes
Vec<Node>
children
&Vec<FlexboxLayoutChild>
last_handle
&mut Option<HWND>
offset
(i32, i32)