Ovverriding viewport position on custom drag visual

Trying to drag and reposition a widget with a custom drag visual within the viewport but with a custom distance constraint. I have my constraint math all setup and working and I’d like to just override any movement when it exceeds the distance constraint and stop it without cancelling the drag and drop operation.

I cannot find a way to do this.

As far as I can tell the drag visual gets no slot, and no canvas panel slot.

Afaik this particular thing is not exposed, we do not get control over the drag visual movement - makes more than this quite awkward at times. You’d need to fake it. If the constraints is exceeded, show a dummy copy of the widget you’re dragging, and hide the real drag.


An alternative here would be to constrain the mouse cursor movement instead, but that may not feel great to the user on the receiving end.

1 Like