yes if your canvas is not clipped to the border top and border left, you must to use something as this :
scrolledY = Math.ceil( window.scrollY );
x = event.clientX - Id("canvasToDraw").offsetLeft;
y = event.clientY + scrolledY - Id("canvasToDraw").offsetTop;
to compute where is your point on the canvas and this point with the border, and on a android tablet i use this :
x = Math.floor( event.touches[0].clientX - Id("canvasToDraw").getBoundingClientRect().left );
y = Math.floor( event.touches[0].clientY + scrolledY - Id("canvasToDraw").getBoundingClientRect().top );
and you must manage the scroll, so the scroll is at 0 with variable scrollY.
make a real software is fun, but that can become a real headache sometime...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
yes if your canvas is not clipped to the border top and border left, you must to use something as this :
to compute where is your point on the canvas and this point with the border, and on a android tablet i use this :
x = Math.floor( event.touches[0].clientX - Id("canvasToDraw").getBoundingClientRect().left );
y = Math.floor( event.touches[0].clientY + scrolledY - Id("canvasToDraw").getBoundingClientRect().top );
and you must manage the scroll, so the scroll is at 0 with variable scrollY.
make a real software is fun, but that can become a real headache sometime...