tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 501HTML 254C 19JavaScript 81414 Sutichaykuna

⎇ 076aca1b7e6f8d292ac3a13f1565ac94aaf1f5bd examples/basic.rs Rust · 21 siq'ikuna · 520 B Ñawpa willay Pi imata llamkarqan ch'uya

Basic test generation working 076aca1b7 · 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 {
10            width: stretch::style::Dimension::Percent(0.5),
11
12            ..Default::default()
13        }],
14
15        ..Default::default()
16    };
17
18    let layout = stretch::compute(&node);
19
20    println!("{:#?}", layout);
21}