8 releases
0.1.0 | May 31, 2020 |
---|---|
0.0.6 | May 31, 2020 |
#19 in #direction
23 downloads per month
10KB
243 lines
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
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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