Settle dirty layout from the leaves upward
This commit is contained in:
1 parent
a640c6cce2
commit
84f589e364
5 files changed
+69
-68
No files matched your search
@@ -131,34 +131,6 @@ fn a_repaint_that_keeps_its_size_does_not_relay_out() {
|
||||
assert_eq!(draws.get(), settled + 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn scrolling_reuses_the_clean_contents_size() {
|
||||
let mut h = Harness::new((400, 200));
|
||||
let (inner, draws) = counted(&mut h, Size::from((400, 600)), OnResize::Translate);
|
||||
let scroll = Scroll::new(inner.add_strong(&mut h.rsc), Axis::Y).add(&mut h.rsc);
|
||||
h.set_root(scroll);
|
||||
let settled = draws.get();
|
||||
|
||||
h.rsc[scroll].scroll(40.0);
|
||||
h.frame();
|
||||
|
||||
assert_eq!(draws.get(), settled);
|
||||
assert_corners!(h, inner, (0, -360), (400, 240));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn scrolling_remeasures_changed_contents() {
|
||||
let mut h = Harness::new((400, 200));
|
||||
let (inner, _) = counted(&mut h, Size::from((400, 600)), OnResize::Translate);
|
||||
let scroll = Scroll::new(inner.add_strong(&mut h.rsc), Axis::Y).add(&mut h.rsc);
|
||||
h.set_root(scroll);
|
||||
|
||||
h.rsc[inner].size = Size::from((400, 800));
|
||||
h.frame();
|
||||
|
||||
assert_corners!(h, inner, (0, -600), (400, 200));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_placed_child_survives_the_next_frame() {
|
||||
let mut h = Harness::new((400, 200));
|
||||
|
||||
Reference in new issue
Block a user