Small fixes

This commit is contained in:
daa84
2017-09-01 16:49:10 +03:00
parent e8b23f18f5
commit a591bda6ee
4 changed files with 16 additions and 21 deletions

View File

@@ -89,6 +89,14 @@ impl Line {
self.dirty_line = true;
}
pub fn clear_draw_cache(&mut self) {
for i in 0..self.item_line.len() {
self.item_line[i] = None;
self.cell_to_item[i] = -1;
}
self.dirty_line = true;
}
fn set_cell_to_empty(&mut self, cell_idx: usize) -> bool {
if self.item_line[cell_idx].is_some() {
self.item_line[cell_idx] = None;

View File

@@ -182,6 +182,12 @@ impl UiModel {
row.clear(left, right);
}
}
pub fn clear_draw_cache(&mut self) {
for row in &mut self.model.iter_mut() {
row.clear_draw_cache();
}
}
}
#[derive(Clone, Debug)]