Documentation
  • Coverage
  • 0%
    0 out of 45 items documented0 out of 14 items with examples
  • Size
  • Source code size: 24.49 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.03 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • yisar/soga
    38 5 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • yisar

soga

Yoga alternative

Build Status crates.io crates.io license

Test

cargo test

Use

use soga::flexbox::FlexBox;
use soga::flexbox::FlexItem;
use std::convert::TryInto;

fn main() {
    let mut root = FlexItem::new(100, 100);

    let child1 = FlexItem::new(100, 50);
    let child2 = FlexItem::new(100, 50);

    root.add(child1);
    root.add(child2);

    let mut flexbox = FlexBox::new();
    flexbox.layout(&mut root);

    assert_eq!(root.children[0].frame, [0, 0, 100, 50]);
    assert_eq!(root.children[1].frame, [50, 0, 100, 50]);
}

License

MIT ©yisar inspired by yoga.