It is interesting to note that Donald Knuth's TeX had basically the same primitives you are laying out here, as he was solving essentially the same problem in a typesetting language. An idea to consider adopting for UI code may be similar to Knuth's hbox and vbox. Where above you specify "layout children in x" to denote behavior, if you have two box primitives for each way that the children flow (vbox for vertical and hbox for horizontal) you may find some code becomes conceptually simpler. The best part is, you can easily add this conceptual model to almost any imgui library with little complexity. Thanks for writing these posts, you are doing excellent work.
It is interesting to note that Donald Knuth's TeX had basically the same primitives you are laying out here, as he was solving essentially the same problem in a typesetting language. An idea to consider adopting for UI code may be similar to Knuth's hbox and vbox. Where above you specify "layout children in x" to denote behavior, if you have two box primitives for each way that the children flow (vbox for vertical and hbox for horizontal) you may find some code becomes conceptually simpler. The best part is, you can easily add this conceptual model to almost any imgui library with little complexity. Thanks for writing these posts, you are doing excellent work.