⎇ 4f43428b5e387dafa19cbcc0c5217fc8e61d0ce6
benches/generated/measure_child_absolute.rs
Historia
Quién tocó qué
crudo
Grid/width depends on height tests (#300)
1pub fn compute() {
2 #[allow(unused_imports)]
3 use taffy::prelude::*;
4 let mut taffy = taffy::Taffy::new();
5 let node0 = taffy
6 .new_leaf_with_measure(
7 taffy::style::Style { position: taffy::style::Position::Absolute, ..Default::default() },
8 taffy::node::MeasureFunc::Raw(|known_dimensions, available_space| {
9 const TEXT: &str = "HHHHHH";
10 super::measure_standard_text(known_dimensions, available_space, TEXT, super::WritingMode::Horizontal)
11 }),
12 )
13 .unwrap();
14 let node = taffy
15 .new_with_children(
16 taffy::style::Style {
17 size: taffy::geometry::Size {
18 width: taffy::style::Dimension::Points(100f32),
19 height: taffy::style::Dimension::Points(100f32),
20 },
21 ..Default::default()
22 },
23 &[node0],
24 )
25 .unwrap();
26 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
27}