Visibility of Text Widget Impact GetDesiredSize Result

I’m wondering whether this is a bug or intended by UE developers. When a text widget is set to visibility “collapse” then the GetDesiredSize function does not return the correct dimension. But when set to “visible” or “hidden”, it will. Could you clarify how is widget visibility related to GetDesiredSize function?

Hello Pelangi,

From your description it appears that this is working as intended. When you set the visibility of a widget to “collapse” it sets the size of the widget to effectively zero. I have provided a link to an AnswerHub question that goes over the visibility settings. I hope that this information helps.

Link: ESlateVisibility Descriptions - Rendering - Epic Developer Community Forums

Make it a great day