feat: use getMappedCoordinates for coordinates

This commit is contained in:
karishmas6
2024-06-14 22:14:52 +05:30
parent d3c4fc8d0d
commit c96ad7bc4c

View File

@@ -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':