⎇ 4f43428b5e387dafa19cbcc0c5217fc8e61d0ce6
benches/generated/measure_width_overrides_measure.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 {
8 size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: auto() },
9 ..Default::default()
10 },
11 taffy::node::MeasureFunc::Raw(|known_dimensions, available_space| {
12 const TEXT: &str = "HHHHHHHHHH";
13 super::measure_standard_text(known_dimensions, available_space, TEXT, super::WritingMode::Horizontal)
14 }),
15 )
16 .unwrap();
17 let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0]).unwrap();
18 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
19}