1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// use morphorm::*;
// use morphorm_ecs::*;
// #[test]
// fn stretch_cross_space_pixels_cross() {
// let mut world = World::default();
// let root = world.add(None);
// world.set_width(root, Units::Pixels(600.0));
// world.set_height(root, Units::Pixels(600.0));
// world.set_layout_type(root, LayoutType::Row);
// world.set_layout_type(root, LayoutType::Row);
// let node = world.add(Some(root));
// world.set_width(node, Units::Pixels(100.0));
// world.set_height(node, Units::Pixels(100.0));
// world.set_top(node, Units::Stretch(1.0));
// world.set_bottom(node, Units::Stretch(1.0));
// root.layout(&mut world.cache, &world.tree, &world.store, &mut ());
// assert_eq!(world.cache.bounds(node), Some(&Rect { posx: 0.0, posy: 250.0, width: 100.0, height: 100.0 }));
// }
// #[test]
// fn stretch_cross_space_percentage_cross() {
// let mut world = World::default();
// let root = world.add(None);
// world.set_width(root, Units::Pixels(600.0));
// world.set_height(root, Units::Pixels(600.0));
// world.set_layout_type(root, LayoutType::Row);
// world.set_layout_type(root, LayoutType::Row);
// let node = world.add(Some(root));
// world.set_width(node, Units::Pixels(100.0));
// world.set_height(node, Units::Percentage(50.0));
// world.set_top(node, Units::Stretch(1.0));
// world.set_bottom(node, Units::Stretch(1.0));
// root.layout(&mut world.cache, &world.tree, &world.store, &mut ());
// assert_eq!(world.cache.bounds(node), Some(&Rect { posx: 0.0, posy: 150.0, width: 100.0, height: 300.0 }));
// }
// #[test]
// fn stretch_cross_space_stretch_cross() {
// let mut world = World::default();
// let root = world.add(None);
// world.set_width(root, Units::Pixels(600.0));
// world.set_height(root, Units::Pixels(600.0));
// world.set_layout_type(root, LayoutType::Row);
// world.set_layout_type(root, LayoutType::Row);
// let node = world.add(Some(root));
// world.set_width(node, Units::Pixels(100.0));
// world.set_height(node, Units::Stretch(1.0));
// world.set_top(node, Units::Stretch(1.0));
// world.set_bottom(node, Units::Stretch(1.0));
// root.layout(&mut world.cache, &world.tree, &world.store, &mut ());
// assert_eq!(world.cache.bounds(node), Some(&Rect { posx: 0.0, posy: 200.0, width: 100.0, height: 200.0 }));
// }