UMG: Visual artifacts when using auto wrap text

Sorry for the delay in getting back to you on this.

The reason this happens is because Tick is called after Slate has already done its pre-pass step. It is this step that updates the desired size of a widget before performing the rest of the layout and paint passes.

Since you’ve set the text after the widget has had its size cached, and since STextBlock only updates its text in ComputeDesiredSize, the visible text cached in the widget won’t be updated until the next pre-pass step (and even if it were updated immediately, the size would be wrong and you’d potentially get clipped text).

If there’s no better place for this logic than Tick, I’d suggest updating the text and then setting the widget to Hidden (as an aside Hidden, unlike Collapsed, will still have a pre-pass done on it). You can then set the visibility to Visible on the next Tick as the text will be up-to-date, although this may introduce a perceived lag in your UI.

Alternatively you could experiment with using bound functions for your text and visibility (although I’d suspect these would have the same issues as they’re not cached so the text would still change between pre-pass and paint), or you could use the “Force Layout Prepass” node to force your text to update (and the widget to re-size) after setting the new text.