fn refresh(&self) {
        let data = self.data.borrow();
        let (w1, h1) = self.window.size();
        let (w2, h2) = data.window_size();

        // Update the window & canvas size
        if w1 != w2 || h1 != h2 {
            self.window.set_size(w2, h2);
            self.canvas.resize();
        }

        // Update the texture data
        let (w2, h2) = data.texture_size();
        let texture_data = data.texture_data();
        self.canvas.set_texture_data(w2, h2, &texture_data);
        self.canvas.render();
        self.status.set_text(0, &format!("Current mode: {:?}; Instances linked: {}", data.mode, data.instances_count()));
        self.invalidate_canvas();
    }
/// Triggered when other instances of syncdraw updated the shared memory
Triggered when other instances of syncdraw updated the shared memory
Triggered when other instances of syncdraw updated the shared memory
fn refresh(&self) {
        let data = self.data.borrow();
        let (w1, h1) = self.window.size();
        let (w2, h2) = data.window_size();
        // Update the window & canvas size
        if w1 != w2 || h1 != h2 {
            self.window.set_size(w2, h2);
            self.canvas.resize();
        }
        // Update the texture data
        let (w2, h2) = data.texture_size();
        let texture_data = data.texture_data();
        self.canvas.set_texture_data(w2, h2, &texture_data);
        self.canvas.render();
        self.status.set_text(0, &format!("Current mode: {:?}; Instances linked: {}", data.mode, data.instances_count()));
        self.invalidate_canvas();
    }
fn refresh ( & self ) { let data = self . data . borrow ( ) ; let ( w1 , h1 ) = self . window . size ( ) ; let ( w2 , h2 ) = data . window_size ( ) ; // Update the window & canvas size if w1 != w2 || h1 != h2 { self . window . set_size ( w2 , h2 ) ; self . canvas . resize ( ) ; } // Update the texture data let ( w2 , h2 ) = data . texture_size ( ) ; let texture_data = data . texture_data ( ) ; self . canvas . set_texture_data ( w2 , h2 , & texture_data ) ; self . canvas . render ( ) ; self . status . set_text ( 0 , & format ! ( " " data mode data instances_count ( ) ) ) ; self . invalidate_canvas ( ) ; }
Triggered when other instances of syncdraw updated the shared memory
Triggered when other instances of syncdraw updated the shared memory
&self