fn calculate(&mut self, measure_text: &mut dyn FnMut(SurfaceId, f32) -> (f32, f32)) {
        self.measure_text_holder = Some(unsafe { std::mem::transmute(measure_text) });
        self.stretch.compute_layout(self.nodes[0], self.window_size).expect("couldnt compute layout");
        self.measure_text_holder = None;

        // TODO: update only attached and display != none nodes
        for i in 0..self.nodes.len() {
            self.bounds[i] = self.stretch.layout(self.nodes[i]).expect("no layout").into()
        }
    }
// TODO: stretch for some reason calls measure quite often
stretch for some reason calls measure quite often
stretch for some reason calls measure quite often
fn calculate(&mut self, measure_text: &mut dyn FnMut(SurfaceId, f32) -> (f32, f32)) {
        self.measure_text_holder = Some(unsafe { std::mem::transmute(measure_text) });
        self.stretch.compute_layout(self.nodes[0], self.window_size).expect("couldnt compute layout");
        self.measure_text_holder = None;
        // TODO: update only attached and display != none nodes
        for i in 0..self.nodes.len() {
            self.bounds[i] = self.stretch.layout(self.nodes[i]).expect("no layout").into()
        }
    }
fn calculate ( & mut self , measure_text : & mut dyn FnMut ( SurfaceId , f32 ) -> ( f32 , f32 ) ) { self . measure_text_holder = Some ( unsafe { std :: mem :: transmute ( measure_text ) } ) ; self . stretch . compute_layout ( self . nodes [ 0 ] , self . window_size ) . expect ( " " ) ; self . measure_text_holder = None ; // TODO: update only attached and display != none nodes for i in 0 .. self . nodes . len ( ) { self . bounds [ i ] = self . stretch . layout ( self . nodes [ i ] ) . expect ( " " ) . into ( ) } }
TODO: stretch for some reason calls measure quite often
TODO : stretch for some reason calls measure quite often
&mut self
measure_text
&mut dyn FnMut(SurfaceId, f32) -> (f32, f32)
&mut self
measure_text
&mut dyn FnMut(SurfaceId, f32) -> (f32, f32)