diff --git a/index.php b/index.php index c31e882..39ba95b 100644 --- a/index.php +++ b/index.php @@ -133,8 +133,8 @@ }; function draw(e) { - var posX = (e.clientX - crect.left) * canvas.width / crect.width - 1; - var posY = (e.clientY - crect.top) * canvas.height / crect.height - 1; + var posX = ((e.clientX - crect.left) * canvas.width) / crect.width - 1; + var posY = ((e.clientY - crect.top) * canvas.height) / crect.height - 1; ctx.putImageData(pen, posX, posY); }