Update index.php

This commit is contained in:
awesomeuser 2023-08-04 15:17:18 +00:00
parent 0356c8776f
commit 480ece73e4

View file

@ -133,8 +133,8 @@
}; };
function draw(e) { function draw(e) {
var posX = ((e.clientX - crect.left) * canvas.width) - 1; // / crect.width var posX = (e.clientX - crect.left) * crect.width / canvas.width - 1;
var posY = ((e.clientY - crect.top) * canvas.height) - 1; var posY = (e.clientY - crect.top) * crect.height / canvas.height - 1;
ctx.putImageData(pen, posX, posY); ctx.putImageData(pen, posX, posY);
} }