pub fn resize(&mut self, size: Vec2) {
        let old_size = self.curr.len();
        let new_size = coord::to_index(size.y * size.x);
        let needs_clear = old_size.min(new_size);
        let default_tile = Tile::default();

        self.curr.resize(new_size, default_tile.clone());
        self.old.resize(new_size, default_tile.clone());

        for tile in &mut self.old[.. needs_clear] {
            *tile = default_tile.clone();
        }
        for tile in &mut self.curr[.. needs_clear] {
            *tile = default_tile.clone();
        }

        self.width = coord::to_index(size.x);
        self.changed.clear();
    }
/// Resizes the screen using the given size.
Resizes the screen using the given size.
Resizes the screen using the given size .
pub fn resize(&mut self, size: Vec2) {
        let old_size = self.curr.len();
        let new_size = coord::to_index(size.y * size.x);
        let needs_clear = old_size.min(new_size);
        let default_tile = Tile::default();
        self.curr.resize(new_size, default_tile.clone());
        self.old.resize(new_size, default_tile.clone());
        for tile in &mut self.old[.. needs_clear] {
            *tile = default_tile.clone();
        }
        for tile in &mut self.curr[.. needs_clear] {
            *tile = default_tile.clone();
        }
        self.width = coord::to_index(size.x);
        self.changed.clear();
    }
pub fn resize ( & mut self , size : Vec2 ) { let old_size = self . curr . len ( ) ; let new_size = coord :: to_index ( size . y * size . x ) ; let needs_clear = old_size . min ( new_size ) ; let default_tile = Tile :: default ( ) ; self . curr . resize ( new_size , default_tile . clone ( ) ) ; self . old . resize ( new_size , default_tile . clone ( ) ) ; for tile in & mut self . old [ .. needs_clear ] { * tile = default_tile . clone ( ) ; } for tile in & mut self . curr [ .. needs_clear ] { * tile = default_tile . clone ( ) ; } self . width = coord :: to_index ( size . x ) ; self . changed . clear ( ) ; }
Resizes the screen using the given size.
Resizes the screen using the given size .
&mut self
size
Vec2
&mut self
size
Vec2