I am currently dragging an element with my mouse, I get the X and Y of the element then subtract half of the height/width:
const newX = X - (width / 2);
const newY = Y - (height / 2);
But I need a way of getting the coordinates of the mouse click inside the element so that the point of dragging isn't the centre of the element, it's wherever the element was first clicked.
How can I do this?
Thanks.