This is a work in progress and it should serve as a basis for continuing brainstorming and for bouncing ideas with others. The code should be considered pseudocode and it doesn't necessarily compile in ReasonML or any language for that matter.
- Layout deals with screen space in Cartesian coordinates: x and y, width and height
- There is a matrix stack which transforms all coordinates prior to drawing. This stack is hidden to the components but it will be used by the renderer to implement layout decisions along the tree.
- Drawing is done using the painter's algorithm and the target is an immediate medium. The element tree will be drawn following a depth-first traversal strategy, meaning every element will be able to paint over its parents and any siblings that came before itself, along with their children.