drag canvas with two canvas

0

I am doing that one can upload the logo and position it anywhere in the background image, the problem is that the drag works with a canvas but with two sometimes it works after a while, they know if there is a way to Do it different ?. What I want is to obtain the position X, Y, width and height of the logo, the background is provided the width and height to be able to visualize it

in this link is where I'm taking: link

    
asked by Albert Arias 28.06.2017 в 00:04
source

1 answer

3

Good morning Albert, you will have noticed that it stops moving ONLY if you scroll, the problem is in the way you grab the coordinates without considering the scroll

What I did was change all the clientX and clientY by pageX and pageY, I leave you the JSFiddle

link

    
answered by 06.07.2017 / 01:24
source