shoji 0.0.5

A vbox/hbox layout system
Documentation

shoji

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.