pub fn render(&mut self) {
        if !self.redraw || !self.old_canvas.is_some() {
            return;
        }

        document()
            .body()
            .unwrap()
            .replace_child(&self.canvas, self.old_canvas.as_ref().unwrap())
            .expect("Could not open document");

        self.old_canvas = None;
        self.redraw = false;
    }
/// Swaps the current frame buffer.
Swaps the current frame buffer.
Swaps the current frame buffer .
pub fn render(&mut self) {
        if !self.redraw || !self.old_canvas.is_some() {
            return;
        }
        document()
            .body()
            .unwrap()
            .replace_child(&self.canvas, self.old_canvas.as_ref().unwrap())
            .expect("Could not open document");
        self.old_canvas = None;
        self.redraw = false;
    }
pub fn render ( & mut self ) { if ! self . redraw || ! self . old_canvas . is_some ( ) { return ; } document ( ) . body ( ) . unwrap ( ) . replace_child ( & self . canvas , self . old_canvas . as_ref ( ) . unwrap ( ) ) . expect ( " " ) ; self . old_canvas = None ; self . redraw = false ; }
Swaps the current frame buffer.
Swaps the current frame buffer .
&mut self