Odd GUI behaviors

Odd GUI behaviors when using multi-line textblocks / WordWrap & onLinesReadyObservable

  1. Recursive error, (but height works) when

Parent.adaptHeightToChildren & setting TextBlock.height within onLinesReadyObservable
Babylon.js Playground

  1. Height doesn’t update without manual parent._rebuildLayout ( & _rebuildLayout also causes a recursive error, unless you unregister observable after first run(https://playground.babylonjs.com/indexStable.html#QH3Q6X#2) )

Using default TextBlock.height (/ 100%) & setting parent.height within onLinesReadyObservable

I’m assuming no.2 is a bug, but i don’t know about no.1

Well this is tricky. you have to limit the call inside onLinesReadyObservable as updating height will force the layout to update and thus the system will end up detecting an infinite cycle


:black_heart:, DK sums up problems with infinity in one easy to read sentence.

just like a Kosh. : )

So here goes an attempt:

From custom-GUI trenches in data vis, there can be infinite-edge-cases in gui layouts, or so it seems.


1 Like

Ahh, alright, so textblock/parent height > _rebuildLayout > onLinesReadyObservable > repeat

will just have to unregister after 1 run and re-register before changes :slight_smile: