Set Widget position as canvas slot is BROKEN in window mode

Hello,

I’m working on a more complex widget hierarchy, but I wanted to debug it in a very simple configuration (and I still can’t), so hence the situation (and the video):
https://streamable.com/p0ksng

Canvas slot has two children (border and EUW_rightClick)
Canvas has OnMouseButtonDown (right click) → try to set the position of EUW_rightClick as a canvas slot at the position of the mouse.

This works in a full screen mode.
But (since I work with a Editor Utility Widget, the tool will never be in full screen) in a window mode, it’s broken.

I suppose I need to work with cached geometry, with Absolute to Local, or Local to Absolute, or maybe Scale by DPI, or get the canvas size (or scale? or its parent?) and divide it by the…I don’t know what…

I’ve been trying and trying again since yesterday and I don’t know what to do anymore. Most tutorial are with viewport (runtime) but I don’t think this is the case for a EUW situation.
I would gladly take any advice.
Thanks.

Hi there,

So this is an editor widget did you tried this?

Seems working

1 Like

Oh THANK G.. YOU !!

I swear I tried so many things, like I did not know if I needed the geometry, and if I did, from the widget I was trying to click on (in my more complex widget, it’s a child of a child) or the geometry of the canevas or the geometry of the widget itself.
And above all, in all the exemples I browsed I saw so many vector 2D stuff that I thought I had to use that one.
But no, it was the COORDINATE one!!

I can go to bed at peace now. Thanks again for taking the time to give me the answer, it’s so simple, and yet I am sure I would have never found out. :slight_smile:

1 Like

Yeah can get complex on some interface hierarchies. Local to world, to viewport then again to local :slight_smile: its like the rotations, you just need to find correct combination :slight_smile:

Even you sometimes did before its sometimes hard to remember / retrieve information for me too, thats where the forums become powerfull to find a specific answer to a specific question. Glad that it worked and happy developing!

1 Like