+ 1
Paint-like program in Javascript problem
Hi, I'm developing a paint-like program in javascript and I have a problem. When the user trigger the mousedown event on the canvas,and then move the mouse, it will be created rects on the mouse position. But if a move more quickly the mouse, there a strange interval in creating the rects. Maybe viewing the code and the final result you will understand https://code.sololearn.com/WOR7EpHbYw7H/#html
2 Réponses
+ 4
Try to replace clientX and clientY with offsetX and offsetY
clientX is the offset from the client window.
offsetX is the offset from the parent element which is the canvas
0
I've tried, but it doesn't work yet