make seperate struct for buffer

This commit is contained in:
Simon Gardling
2021-04-01 13:56:10 -04:00
parent d887b13579
commit af0b9f9222
6 changed files with 63 additions and 24 deletions

View File

@@ -165,14 +165,8 @@ impl Model {
);
}
fn strip_grid_data(grids: Vec<Grid>) -> Vec<ThinGridData> {
return grids.iter().map(|grid| {
ThinGridData::from_grid(grid)
}).collect();
}
fn save_image_data(&mut self) {
let grids = Self::strip_grid_data(self.grids.clone());
let grids = ThinGridData::new_from_grid_vec(self.grids.clone());
let img_data = ImgData::new(grids, self.palette, self.iteration);
self.img_data_vec.push(img_data);
if self.grids[0].width > 1024 && self.grids[0].height > 1024 && self.img_data_vec.len() > 100 {