fix mouse coords when zoomed
This commit is contained in:
parent
8067b9bb46
commit
dcc1d7e11e
|
|
@ -921,8 +921,8 @@ function vectorDist(a, b) {
|
|||
function getMousePos(canvas, evt) {
|
||||
var rect = canvas.getBoundingClientRect();
|
||||
return {
|
||||
x: evt.clientX - rect.left,
|
||||
y: evt.clientY - rect.top
|
||||
x: (evt.clientX - rect.left) / zoomLevel,
|
||||
y: (evt.clientY - rect.top) / zoomLevel
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue