Issue with layout calculation and word wrapping

I’m working on a process where I define individual tutorial UI in separate UXML files and dynamically load them into a generic tutorial Document (Inside a VisiualElement in a ScrollView). For the most part this is working, but the layout isn’t calculating correctly. The labels are set to word wrap, and are in fact displaying with word wrapping correctly. The problem is the Label element isn’t growing in size, so labels overlap, and the scrollview doesn’t expand to see all the text.

When using the debugger tool, if I change label font style to bold and back, it recalculates and grows the label element size. I’ve tried calling a MarkDirtyRepaint() after populating the VisualElement with the contents, but that isn’t working.

Does this look like a bug? Is there something I can be doing in code to force the layout to calculate correctly?

Element Hierarchy I’m using:

  • ScrollView

  • VisualElement (from base UIDocument)

  • VisualElement (from child UI Document)

  • Label

  • Label

Bump! I’ve still not figured out how to solve this.

This seems to be a more fundamental issue with word wrapping. Even with no dynamic stuff as I was doing in the original post, simply having text that wraps, it’s not correctly sizing. Below is an example, the text wraps into the next element, if I do something to slightly resize the window after the fact, it corrects.

Can anyone from Unity comment on if there is formatting issues with word wrapping with Preview.13?

bump.

This sure looks like a bug. Can you report it with Help->Report a bug … and provide as much information as you can. This will help us keep track of it.

@uMathieu , do think this is same bug as above?