tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 1100HTML 1031Markdown 12TOML 84455 Definiciones

⎇ 41b87b578c1918acbd991665fc37cd61e5d24f22 examples/basic.rs Rust · 17 líneas · 487 B Historia Quién tocó qué crudo

customize formatting 41b87b578 · Emil Sjölander ·

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