How to get parent widget geometry

Hi All,

what would be the correct approach to get parent widget geometry?
I need this data for viewport position calculation and my current implementation just takes the geometry returned by the Tick Event and assigns it to a variable of my child widget, it works though it creates a circular dependency and sometimes I get the “Graph is linked to private object(s) in an external package” error, in which case I need to compile the parent widget and then save.

Is there a better way to get the geometry or a solution to avoid this error from happening?

Regards,

what you can do is tracking your geometry, and the apply a render transform to your widget on the event tick. no need to transfer the position in your widget using this method/

Not sure if I get what you mean? I use the parent widget geometry for getting “local size” of the viewport and for calculating mouse location in the viewport by using “absolute to local” with the “GetLastScreenSpacePosition”.

I’ve tried using DisplaySize/DisplayScale and GetMousePositionScaledByDPI, works in theory but in not in production :smiley:

Looks like I’ve missed the AbsoluteToViewport function that you can call from GetScreenSpacePostion, with that function I don’t require the geometry anymore as the ViewportSize/ViewportScale returns the correct current viewport size.