Skip to content
Snippets Groups Projects
Commit 696c5ed6 authored by kyk1047715's avatar kyk1047715
Browse files

s

parent a2255b94
No related branches found
No related tags found
No related merge requests found
...@@ -87,7 +87,8 @@ ...@@ -87,7 +87,8 @@
} }
function getPosition(event){ function getPosition(event){
var x = event.x; var bound = canvas.getBoundingClientRect();
var y = event.y; var x = (event.pageX - bound.left) * (canvas.width / bound.width);
var y = (event.pageY - bound.top) * (canvas.height / bound.height);
return {X: x, Y: y}; return {X: x, Y: y};
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment