pub fn process_visual_updates(&mut self) {
        // Not ideal
        let tree = self.tree.clone();

        apply_z_ordering(self, &tree);
        apply_visibility(self, &tree);

        // Layout
        if self.style.needs_relayout {
            apply_text_constraints(self, &tree);

            // hack!
            let mut store = (Style::default(), TextContext::default(), ResourceManager::default());
            std::mem::swap(&mut store.0, &mut self.style);
            std::mem::swap(&mut store.1, &mut self.text_context);
            std::mem::swap(&mut store.2, &mut self.resource_manager);

            layout(&mut self.cache, &self.tree, &store);
            std::mem::swap(&mut store.0, &mut self.style);
            std::mem::swap(&mut store.1, &mut self.text_context);
            std::mem::swap(&mut store.2, &mut self.resource_manager);

            self.style.needs_relayout = false;
        }

        apply_transform(self, &tree);
        apply_hover(self);
        apply_clipping(self, &tree);

        // Emit any geometry changed events
        geometry_changed(self, &tree);
    }
/// Massages the style system until everything is coherent
Massages the style system until everything is coherent
Massages the style system until everything is coherent
pub fn process_visual_updates(&mut self) {
        // Not ideal
        let tree = self.tree.clone();
        apply_z_ordering(self, &tree);
        apply_visibility(self, &tree);
        // Layout
        if self.style.needs_relayout {
            apply_text_constraints(self, &tree);
            // hack!
            let mut store = (Style::default(), TextContext::default(), ResourceManager::default());
            std::mem::swap(&mut store.0, &mut self.style);
            std::mem::swap(&mut store.1, &mut self.text_context);
            std::mem::swap(&mut store.2, &mut self.resource_manager);
            layout(&mut self.cache, &self.tree, &store);
            std::mem::swap(&mut store.0, &mut self.style);
            std::mem::swap(&mut store.1, &mut self.text_context);
            std::mem::swap(&mut store.2, &mut self.resource_manager);
            self.style.needs_relayout = false;
        }
        apply_transform(self, &tree);
        apply_hover(self);
        apply_clipping(self, &tree);
        // Emit any geometry changed events
        geometry_changed(self, &tree);
    }
pub fn process_visual_updates ( & mut self ) { // Not ideal let tree = self . tree . clone ( ) ; apply_z_ordering ( self , & tree ) ; apply_visibility ( self , & tree ) ; // Layout if self . style . needs_relayout { apply_text_constraints ( self , & tree ) ; // hack! let mut store = ( Style :: default ( ) , TextContext :: default ( ) , ResourceManager :: default ( ) ) ; std :: mem :: swap ( & mut store . 0 , & mut self . style ) ; std :: mem :: swap ( & mut store . 1 , & mut self . text_context ) ; std :: mem :: swap ( & mut store . 2 , & mut self . resource_manager ) ; layout ( & mut self . cache , & self . tree , & store ) ; std :: mem :: swap ( & mut store . 0 , & mut self . style ) ; std :: mem :: swap ( & mut store . 1 , & mut self . text_context ) ; std :: mem :: swap ( & mut store . 2 , & mut self . resource_manager ) ; self . style . needs_relayout = false ; } apply_transform ( self , & tree ) ; apply_hover ( self ) ; apply_clipping ( self , & tree ) ; // Emit any geometry changed events geometry_changed ( self , & tree ) ; }
Massages the style system until everything is coherent
Massages the style system until everything is coherent
&mut self