I implemented a scratch card component effect with canvas
but there is a bug
quasi-basket mouse position
smear position is correct when the mouse position is on the right edge
there is a shift when the mouse position is on the left edge, as shown
my code is as follows:
this.context.arc(touch.pageX - this.canvas.offsetLeft, touch.pageY - this.canvas.getBoundingClientRect().top + 10, 20, 0, Math.PI * 2);
what is the reason for the shift? Also look at the correction, thank you