Morphorm

Morphorm is a crate for determining the position and size of UI elements which are organised in a visual tree. The algorithm is written from scratch but is based on the subform layout system.

How to use

To try and keep things as generic as possible Morphorm does not provide any containers for representing the layout properties or visual tree. Instead, three traits must be implemented by the users' containers in order to utilise the layout algorithm:

Once the appropriate traits have been implmented, layout can be performed on the whole tree, e.g. rs layout(&mut world.cache, &world.tree, &world.store); In this example the cache, tree, and a store for the node properties are kept in an ECS world struct and a node is simply an entity id.

See examples for details.

Layout system description

TODO

An overview of stacks can be found here: overview (stacks)