cassowary

Crates.iocassowary
lib.rscassowary
version0.3.0
sourcesrc
created_at2016-04-30 17:13:30.674561
updated_at2017-09-13 20:04:34.589162
descriptionA Rust implementation of the Cassowary linear constraint solving algorithm. The Cassowary algorithm is designed for naturally laying out user interfaces using linear constraints, like 'this button must line up with this text box'.
homepagehttps://github.com/dylanede/cassowary-rs
repositoryhttps://github.com/dylanede/cassowary-rs
max_upload_size
id4932
size92,635
Dylan Ede (dylanede)

documentation

https://dylanede.github.io/cassowary-rs

README

cassowary-rs

Build Status

This is a Rust implementation of the Cassowary constraint solving algorithm (Badros et. al 2001). It is based heavily on the implementation for C++ at nucleic/kiwi. The implementation does however differ in some details.

Cassowary is designed for solving constraints to lay out user interfaces. Constraints typically take the form "this button must line up with this text box", or "this box should try to be 3 times the size of this other box". Its most popular incarnation by far is in Apple's Autolayout system for Mac OS X and iOS user interfaces. UI libraries using the Cassowary algorithm manage to achieve a much more natural approach to specifying UI layouts than traditional approaches like those found in HTML.

This library is a low level interface to the solving algorithm, though it tries to be as convenient as possible. As a result it does not have any intrinsic knowledge of common user interface conventions like rectangular regions or even two dimensions. These abstractions belong in a higher level crate.

For more information, please read the documentation.

Getting Started

Add the following to your Cargo.toml:

[dependencies]
cassowary = "^0.3.0"

Please read the documentation (linked above) for how to best use this crate.

License

Licensed under either of

at your option.

Contribution

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

Commit count: 26

cargo fmt