layout: a bordered scroll box that fits scrolls nowhere
This commit is contained in:
parent
a8d234cfdb
commit
820f43de77
1 changed files with 6 additions and 0 deletions
|
|
@ -1161,6 +1161,12 @@ fn scroll_extent_is_measured_from_the_padding_box() {
|
|||
let laid = lay(bx("root", plain(), vec![bx_paint("list", style, paint, rows)]), 400.0, 300.0);
|
||||
let list = laid.nodes.iter().find(|n| n.id.as_str() == "list").unwrap();
|
||||
assert_eq!(list.max_scroll, Some((68.0, 158.0)));
|
||||
// Content that fits the padding box scrolls nowhere, though `content` is held at the border box.
|
||||
let paint = Paint { background: None, border: Some(Border { color: ColorRef::Rgba(Rgba { r: 0, g: 0, b: 0, a: 255 }), width: 4.0 }), radius: 0.0 };
|
||||
let small = BoxStyle { overflow: Overflow::Scroll, ..sized(100.0, 100.0) };
|
||||
let laid = lay(bx("root", plain(), vec![bx_paint("fit", small, paint, vec![bx("kid", sized(10.0, 10.0), vec![])])]), 400.0, 300.0);
|
||||
let fit = laid.nodes.iter().find(|n| n.id.as_str() == "fit").unwrap();
|
||||
assert_eq!((fit.content, fit.max_scroll), (Some((100.0, 100.0)), Some((0.0, 0.0))));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue