8 releases

0.1.0 May 31, 2020
0.0.6 May 31, 2020

#16 in #direction

MIT/Apache

10KB
243 lines

shoji

docs.rs docs

A vbox/hbox layout library implemented in Rust.

[dependencies]
shoji = "0.0"

Example

use shoji::*;

fn main() -> Result<(), &'static str> {
    let mut shoji = Shoji::new();
    
    let child = shoji.new_node(
        LayoutStyle { ..Default::default() },
        vec![],
    )?;

    let node = shoji.new_node(
        LayoutStyle {
            direction: Direction::TopBottom,
            ..Default::default()
        },
        vec![child],
    )?;

    shoji.compute_layout(node, Size::undefined())?;
    dbg!(shoji.layout(node)?);
}

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in shoji by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~56KB