TextArea: invalidate cache on set_content

This commit is contained in:
Alexandre Bury 2018-01-16 10:30:26 -08:00
parent 868e59a4fa
commit 6bb0812a39

View File

@ -95,6 +95,7 @@ impl TextArea {
} }
if let Some(size) = self.size_cache.map(|s| s.map(|s| s.value)) { if let Some(size) = self.size_cache.map(|s| s.map(|s| s.value)) {
self.invalidate();
self.compute_rows(size); self.compute_rows(size);
} }
} }
@ -227,6 +228,7 @@ impl TextArea {
fn soft_compute_rows(&mut self, size: Vec2) { fn soft_compute_rows(&mut self, size: Vec2) {
if self.is_cache_valid(size) { if self.is_cache_valid(size) {
debug!("Cache is still valid.");
return; return;
} }
debug!("Computing! Oh yeah!"); debug!("Computing! Oh yeah!");