Hi guys,
I’m currently facing an issue related to the desired size of an UUserWidget. I need to know this desired size beforehand in order to perform some size validations before actually drawing the widget (the validation determines how the widget will de drawn). In order to do that, I first force the layout prepass of the UUserWidget so the cached widget has non-empty values and then I get the desired size of the widget.
MyUserWidget->ForceLayoutPrepass();
FVector2D DesiredSize = MyUserWidget->GetDesiredSize();
However the desired size of the widget is slightly smaller than the actual size, making my validation fail. I know this reuslt is expected, based on the explanation given here, so the question is: Is there any way to obtain a more accurate value from GetDesiredSize()? or how could I approach having the precise size before actually drawing the widget or avoiding re-rendering of the widget?
Thanks