From c96ad7bc4c5cf43856f828b3ed0541a3eb939cc5 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Fri, 14 Jun 2024 22:14:52 +0530 Subject: [PATCH] feat: use getMappedCoordinates for coordinates --- src/components/atoms/canvas.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/atoms/canvas.tsx b/src/components/atoms/canvas.tsx index 33f45698..6a2f9dea 100644 --- a/src/components/atoms/canvas.tsx +++ b/src/components/atoms/canvas.tsx @@ -50,11 +50,8 @@ const Canvas = ({ width, height, onCreateRef }: CanvasProps) => { } switch (event.type) { case 'mousedown': - // const clickCoordinates = getMappedCoordinates(event, canvasRef.current, width, height); - socket.emit('input:mousedown', { - x: event.clientX, - y: event.clientY, - }); + const clickCoordinates = getMappedCoordinates(event, canvasRef.current, width, height); + socket.emit('input:mousedown', clickCoordinates); notifyLastAction('click'); break; case 'mousemove':