The usual method of set x,y to mouse x,y, always moves the object to its hotspot.
This method gets the offset from the hotspot, or basically gets the relative coordinate from where you clicked, and moves it there.
Ie click a corner, drag that corner, not drag from the hotspot.
Demo here:
no offset drag and drop