frame test: out of range by two slabs
This commit is contained in:
parent
2caf18fe73
commit
283e0d584c
1 changed files with 10 additions and 2 deletions
|
|
@ -248,9 +248,17 @@ fn no_room_draws_nothing_without_a_diagnostic_and_the_next_frame_draws_again() {
|
|||
#[test]
|
||||
fn a_layout_past_the_precision_bound_keeps_the_last_good_frame() {
|
||||
let good = say(1, "fits");
|
||||
let mut wide = say(2, "does not fit");
|
||||
// Two boxes side by side that together reach past the bound: neither alone is refused.
|
||||
let slab = |id: &str| match boxed(id, vec![]) {
|
||||
Node::Box(mut slab) => {
|
||||
slab.style.size = size2(px(1_500_000.0), px(10.0));
|
||||
Node::Box(slab)
|
||||
}
|
||||
other => other,
|
||||
};
|
||||
let mut wide = inline(2, boxed("root", vec![slab("left"), slab("right")]));
|
||||
if let Node::Box(root) = &mut wide.root {
|
||||
root.style.size = size2(px(3_000_000.0), px(10.0));
|
||||
root.style.direction = Direction::Row;
|
||||
}
|
||||
let mut state = MemState::new();
|
||||
state.put(&good.provider_id, &good);
|
||||
|
|
|
|||
Loading…
Reference in a new issue