tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 1068HTML 999Markdown 12TOML 83189 Definiciones

⎇ 951f658e7a383c52e38a65daeb539e4dcee32913 examples/basic.rs Rust · 15 líneas · 464 B Historia Quién tocó qué crudo

Rust 2018 is here 🎉 951f658e7 · Pascal Hartig ·

1fn main() {
2    let node = stretch::style::Node {
3        width: stretch::style::Dimension::Points(100.0),
4        height: stretch::style::Dimension::Points(100.0),
5        justify_content: stretch::style::JustifyContent::Center,
6
7        children: vec![stretch::style::Node { width: stretch::style::Dimension::Percent(0.5), ..Default::default() }],
8
9        ..Default::default()
10    };
11
12    let layout = stretch::compute(&node);
13
14    println!("{:#?}", layout);
15}