Layout cycle detected in GUI (Container uniqueId=XX)

So, I was happy to find out that this was going to be our permanent :houses:. And was thinking to blog my long time personal stuff in the Projects category until I ran it today and found ‘Layout cycle detected in GUI (Container uniqueId=XX)’ error message !

Poof, my GUI is borked :sob: ! Now I know its the holiday season and all, is there a need for a repro or are the devs already aware or did I miss a new feature ? Sorry for the many questions, haven’t caught up with all the new posts yet. :slight_smile:

Hey and welcome home:)

Can you repro in the PG? As part of 4.0 I’ve reworked the way the GUI evaluates its layout to support feature like correct stackpanel or scrollviewer

https://www.babylonjs-playground.com/index.html#XCPP9Y#815 This one :sweat_smile:

Here is your fix:
https://www.babylonjs-playground.com/index.html#XCPP9Y#816

On line #50: you have to give your rectangle a height as it is a child of a vertical StackPanel. I’ll make sure to display a warning now to help people find this kind of issues :slight_smile:

Well that gets rid of the layout cycle error indeed, but the other stuff remains broken?

Edit: I see you replied in the other post :slightly_smiling_face:

Well, thanks @Deltakosh, I fixed the new command for stackpanels but the error still persists plus a few more new ones I haven’t seen before and my characters are doing moonwalks all of a sudden. :sweat_smile:

Gonna be a while before I find time to get a repro, meanwhile…here’s a pic of the errors I have so far.

As soon as you can repro I’ll make sure to fix it!

1 Like

Just cos you asked: https://www.babylonjs-playground.com/index.html#XCPP9Y#827

Running it will throw the identical Layout cycle detected in GUI error, commenting out text1.paddingLeft = "5%"; solves the problem. Another weird one, I guess…

Will make sure to fix it asap (currently in my family in France so computer access is kind of regulated:) )

Actually this is the same one. You cannot use paddingLeft in percentage inside an horizontal stackpanel.
Indeed, the panel will computes it’s weight from its controls (padding and width) which in turn will define their position and size from the panel width. This is recursive:)

1 Like

I will update the panel to throw a warning if such a case is found

1 Like

ok, got it. Just to be clear: the new stackpanel width/height definitions override % control paddings. Control paddings, if needed, should only be defined in px ?

this is correct. previous behaviour was wrong :slight_smile:

Understood, how do I mark this thread as solved ? Or is this currently only smthg a mod can do ?

Oh, btw. To @Deltakosh and the whole team: Merry X’mas and happy holidays! :partying_face:

1 Like

Did it:)