Update scrollbase on any row computation

This commit is contained in:
Alexandre Bury 2016-08-03 00:01:18 -07:00
parent 095367166b
commit 6827d2ed59

View File

@ -213,6 +213,7 @@ impl TextArea {
if !self.rows.is_empty() { if !self.rows.is_empty() {
self.last_size = Some(SizeCache::build(size, size)); self.last_size = Some(SizeCache::build(size, size));
} }
self.scrollbase.set_heights(size.y, self.rows.len());
} }
fn backspace(&mut self) { fn backspace(&mut self) {
@ -346,7 +347,6 @@ impl TextArea {
// Here, we know it's just no gonna happen. // Here, we know it's just no gonna happen.
self.invalidate(); self.invalidate();
self.compute_rows(size); self.compute_rows(size);
self.scrollbase.set_heights(size.y, self.rows.len());
return; return;
} }
@ -456,6 +456,5 @@ impl View for TextArea {
fn layout(&mut self, size: Vec2) { fn layout(&mut self, size: Vec2) {
self.compute_rows(size); self.compute_rows(size);
self.scrollbase.set_heights(size.y, self.rows.len());
} }
} }