Description
It would be cool if we were able to get a widgets size before actually rendering it. I know this is a fundamental limitation of immediate mode UIs, but it should be easily possible to do this, right? Basically we just make all of the calls except the ones that take any effect on the screen.
My situation is that I have a row of items with different sizes, and I want the entire row to have the same height. When I add the tallest item first, this works, because then the later elements know their height. But when the tallest element is not the first, then the first item will not know how tall it should be. So I would like to iterate through all elements before rendering them, to calculate their sizes and find the max height, then set use that height for all elements when rendering them.
The idea is basically to render to an offscreen buffer, just to get the final size of the Ui
, without actually rendering anything. If there is some way to know if the Ui
changed it would also be possible to cache something here, but I doubt that this will be possible without compromising developer experience.