Incorrect mouse position in UUserWidget

Hi,

I am trying to implement a widget in C++. The design part of the widget is done in the editor.

When I try to get the position of the mouse inside my widget I am getting some weird values. When I hover the mouse over the top left corner of this widget, I do not get 0, 0. I am getting negatives for both X and Y. Somewhere toward the center of the widget is where 0, 0 is located, but not exactly in the center. Clearly I am doing something wrong.

Here is the code how I am converting the pointer position. This is inside the NativeOnDragOver function:

The widget has some elements that are bound in c++

This is what it looks like in editor.

image

image

Thanks for any help!