same size widget drag and drop

when i drag the selected slot outside the inventory it’s not the same size of slot dragged out.
how can i make the same size?
how can i take the image from slot selected and assign to slot dragged out ?
thanks.

I’m just now getting into UMG, which I’m assuming this might be tied to, so my experience is limited. But could it be that the slot you’re dragging it out of has some sort of scaling tied to the image?

Have you set the contents of the slot in the inventory to scale to size, so when dragging it out it snaps back to original size for instance?

Resolved!

Please, give information of the solved issue for other members.

While creating drag n drop operation, I got absolute size of widget and normalized it with viewport scale, then I passed this normalized size as new width of newly created widget.



image

Scaler is a scale box which scales in “fit to x” mode so the final widget has same width as “ScalerSizeBox” width override.

2 Likes

Thanks a lot for your reply !

or… you just add a SizeBox as Root of a the Slot Widgets and the Drag&Drop Widget… same Size… no problem…

No. The problem is that size box of non-dnd widget will (most likely) be scaled according to many scaling rules of your UI. That’s why we need to calculate real non-dnd widget size, not abstract one you specify in UMG editor, to set it to dnd widget that has no scaling influences.