Get correct size and position of slot in UMG

Get Slot as Canvas Slot → Get Position / Get Size returns incorrect values

How I discovered that

I want to calculate min and max Xs and Ys of the “ViewPanel”.
I do that by adding position X,Y with size X,Y respectively.

When I try to check the DeltaX and DeltaY based on where the player clicked (inside the ViewPanel), I get incorrect results near edges (Instead of ~0 , I get numbers like 200 , 183 etc…)

Some screenshots:

70337-screenshot_1.png

You need to get Mouse Position Scaled by DPI from Player Controller. It is the go-to node for messing around with the viewport.