From 61e7c636833e46aafcfc8a9999b65f8d462961e9 Mon Sep 17 00:00:00 2001 From: awesomeuser Date: Fri, 4 Aug 2023 15:17:55 +0000 Subject: [PATCH] Update index.php --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 266788f..c31e882 100644 --- a/index.php +++ b/index.php @@ -133,8 +133,8 @@ }; function draw(e) { - var posX = (e.clientX - crect.left) * crect.width / canvas.width - 1; - var posY = (e.clientY - crect.top) * crect.height / canvas.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); }